stocky-fountain-57774
02/14/2024, 12:47 PMancient-application-36103
02/14/2024, 3:17 PM.env ?ancient-application-36103
02/14/2024, 3:18 PMancient-application-36103
02/14/2024, 3:19 PMstocky-fountain-57774
02/14/2024, 4:02 PMstocky-fountain-57774
02/14/2024, 4:03 PMancient-application-36103
02/14/2024, 4:04 PMstocky-fountain-57774
02/14/2024, 4:05 PMstocky-fountain-57774
02/14/2024, 4:06 PMstocky-fountain-57774
02/14/2024, 4:06 PMstocky-fountain-57774
02/14/2024, 4:06 PMfresh-laptop-72652
02/14/2024, 9:08 PM@secrets (docs) -- you can create a secrets manager entry for each of your environments that contains the corresponding environment variables for it
when deploying the flows, you can inject those secrets onto the steps, e.g. for production
python flow.py --production --with 'secrets:sources=["prod"]' step-functions create
if you have a separate namespace for staging, could likewise create a non-prod deployment with a staging secretstocky-fountain-57774
02/15/2024, 7:03 AMpython flow_dotenv.py --environment=pypi --package-suffixes=.env step-functions create
When I just run the flow, even without specifying --package-suffixes=.env, it gets the env value. But when launching the flow from Step Functions, It is absent.
With run I have :
secret message: secret_value from a container
And with Step Functions :
secret message: None from a container
Is it supposed to work with step-functions create ?fresh-laptop-72652
02/15/2024, 7:48 AM--package-suffixes it will only grab those files that are in the same dir or subdirs as the flow, not parent dirs (you could work around that with symlinks however)
you can verify what files will be included in the code artifact by running package list, e.g.
python flow_dotenv.py --environment=pypi --package-suffixes=.env package list
that said, it really doesn't sound like you should be doing that, as that's implying you have production secrets checked into your repo as an .env file – would highly encourage using @secrets and then you can isolate those environment variables for staging/prod and provision them as appropriate for each deploymentstocky-fountain-57774
02/15/2024, 8:47 AM@secrets ?
Using package list I get an enormous number of files, using grep doesn't work (I'm looking for a way to achieve this), but there doesn't seem to be my .env file. It is in the same folder as the flow so I don't really understand.stocky-fountain-57774
02/15/2024, 8:47 AMstocky-fountain-57774
02/15/2024, 9:01 AMancient-application-36103
02/15/2024, 4:08 PMfresh-laptop-72652
02/15/2024, 4:40 PMwe don't really need secret values, mostly simple parameters. Would you still recommendit's ultimately just injecting environment variables to the steps at runtime, whether or not those are "secret" in the sense that they're sensitive isn't a requirement – both should work and just wanted to call out the options 🙂 as an example that I've found to work pretty well: • locally we have?@secrets
.env files that are automatically loaded using direnv for the environment variables that configure runtime behavior, API endpoints, keys, local DB creds, etc
• remotely we have an @secret that mimics those environment variables, but with the values corresponding to the respective environment (staging, prod)bulky-afternoon-92433
02/19/2024, 10:42 AM