Scott Zelenka
06/04/2020, 6:04 PMPrefectSecret
to read from?
Our use case is that we have different key/value pairs depending on the lifecycle the Flow is being executed in, so we split that up into two different Secrets, and use a Parameter to trigger which lifecyle it should attempt to process:
with Flow() as flow:
lifecycle = Parameter("lifecycle", default='dev')
secrets = PrefectSecret(f"SECRET_NAME_{lifecycle.run().upper()}")
That seems hacky, to have to call .run()
on the Parameter though. Wondering if anyone found a cleaner approach.nicholas
06/04/2020, 6:08 PM@task
def my_task(x):
some_secret = Secret("SECRET_NAME_{x}").get()