Pretty basic question here. We have users developi...
# ask-metaflow
c
Pretty basic question here. We have users developing locally and using step functions for orchestration. The step functions users have the capability to access our stores via user/PW combinations. Local development users are not capable of using that, so they have to alter the auth method to use an SSO provider. The question is, normally I would have a function that checks OS variables regarding which auth method to use, but I can't do that here. Is there a seamless way to have it resolve where/how the flow is running and alter the code around that? Would it be a parameter we declare with a default and then we override it in the step functions console within AWS? Really curious on this problem, and greatly appreciate any help. The answer here will get matriculated into our shared libraries and become the "This is how we handle this problem" process for the rest of the team to follow.
1
a
@clean-megabyte-14460 - is it fair to interpret this problem as wanting to distinguish whether the flow is running locally vs on step-functions?
bool(os.environ.get('SFN_STATE_MACHINE'))
would indicate whether the execution is happening within step function
c
Yeah its fair to say that's the case, where we would be able to switch the auth method around based on where its running
If we were taking it a step further @square-wire-39606 and attempting to populate a set of environment variables, we would probably need to go the docker route? Or parameters?
a
the env var
SFN_STATE_MACHINE
is already populated by Metaflow and set to the execution name of the state machine
to populate env vars, we have the
@environment
decorator - https://outerbounds.com/docs/set-env-vars-with-decorator/
1