https://prefect.io logo
Title
p

Patrick Tan

06/01/2022, 3:48 PM
Hi, I am storing flow in S3. Setting credential with environment variable PREFECT__CONTEXT__SECRETS__AWS_CREDENTIALS prior to running python code works, but it does not work if I set the environment variable inside python program like this.
k

Kevin Kho

06/01/2022, 4:29 PM
It needs to be set before you import Prefect because the context is created when Prefect is imported
p

Patrick Tan

06/01/2022, 5:33 PM
it works! but having to set env before import is not so elegant. Is there any other option to pass AWS credential for storing flow to S3 bucket?
k

Kevin Kho

06/01/2022, 5:34 PM
Any reason why you didn’t use secrets ?
p

Patrick Tan

06/01/2022, 5:41 PM
OK, if secrets work, I need to learn using secrets. :)
k

Kevin Kho

06/01/2022, 6:19 PM
Yes secrets will remove this headache for you