Tobias11/11/2022, 8:25 AM
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?
from prefect_aws import MinIOCredentials
Nate11/11/2022, 4:18 PM
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
Question: What is the recommended way of working with environment variables in this case?
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
pip install prefect-snowflake prefect block register -m prefect_snowflake.credentials
-- however if you really just want to use env vars, I would just set as many of them as you want in the
from prefect.blocks.system import Secret my_secret = Secret.load("my-secret").get()
field of the infrastructure block as you mentioned in part 1 of your question
Tobias11/14/2022, 7:50 AM