Stephen Lloyd
04/11/2022, 3:39 PM>>> from prefect import Client
>>> client = Client()
>>> client.set_secret(name="test", value="test")
>>> client.set_secret(name="AWS_ACCOUNT_ID-dev", value="123456789098")
It seems like I should be able to use
from prefect.client import Secret
aws_account_id = Secret('AWS_ACCOUNT_ID-' + RUN_ENV).get()
However, I receive the following error:
ValueError: Local Secret "AWS_ACCOUNT_ID-dev" was not found.
How can I retrieve a secret value outside of a task?Kevin Kho
04/11/2022, 3:43 PMexport PREFECT__CLOUD__USE_LOCAL_SECRETS=false
and this will pull the Cloud SecretStephen Lloyd
04/12/2022, 3:32 AMKevin Kho
04/12/2022, 3:41 AMStephen Lloyd
04/12/2022, 3:44 AMKevin Kho
04/12/2022, 3:52 AMPREFECT__CLOUD__XXX_XXX
for example to your flow to them to take effectStephen Lloyd
04/13/2022, 4:16 AMexport PREFECT…SECRETS=false
I get the expected behavior.
• If I change the default config path with export PREFECT__USER_CONFIG_PATH=/Users/slloyd/projects/my_path/.prefect
with use_local_secret=false
I do not get the expected behavior
• If I put the file in $HOME/.prefect/config.toml
with use_local_secret=false
in a docker image I do not get the expected behavior.
Do you know what I am missing?Kevin Kho
04/13/2022, 1:49 PMconfig.toml
in Docker. Would you be willing to write an issue about it? I can also open one and you can add your details there? You can use the RunConfig as that works