Tobias
11/11/2022, 8:25 AMfrom prefect_aws import MinIOCredentials
3. I can also see that adding Secrets to Prefect Cloud is an option in 1.0, but this seems not to be possible in 2.0?Nate
11/11/2022, 4:18 PMQuestion: What is the recommended way of working with environment variables in this case?
It kind of depends in my opinion!
For example, if your flow just needs access to a snowflake username / password so it can create a connection object for snowflake, I would define some SnowflakeCredentials / SnowflakeConnector blocks that you can load in to handle that for you, which you can do with
pip install prefect-snowflake
prefect block register -m prefect_snowflake.credentials
and then configuring them in the UI
--
secrets do exist in prefect 2, they're just a special type of Block now. You can configure them in the UI by going to Blocks + and then load them in your flows like
from prefect.blocks.system import Secret
my_secret = Secret.load("my-secret").get()
--
however if you really just want to use env vars, I would just set as many of them as you want in the env
field of the infrastructure block as you mentioned in part 1 of your questionTobias
11/14/2022, 7:50 AM