Hello! I am running into an interesting problem. I...
# prefect-community
m
Hello! I am running into an interesting problem. I am using a parameter called "lifecycle" in my flow (Dev and Prod) which determines which secret the flow should be using. The secrets are set using the following code:
Copy code
lifecycle = Parameter("lifecycle")
    true_branch = PrefectSecret("SCM_AUTOMATION_PROD")
    false_branch = PrefectSecret("SCM_AUTOMATION_DEV")
    ifelse(tasks.get_lifecycle(lifecycle), true_branch, false_branch)

    secrets = merge(true_branch, false_branch)
When I run this flow locally, setting the lifecycle parameter set to DEV it works as expected. However, on the cloud, it is only using the PROD secret. Any guidance on why this might be happening? I am positive the cloud secrets are all configured correctly and the issue seems to be with the IFELSE, MERGE Thanks in advance!
d
Hi @Maura Drabik! What does
tasks.get_lifecycle(lifecycle)
return?
Also, would you mind sharing a full reproducible example?
You could also have
tasks.get_lifecycle()
return the name of the secret you want and then call
PrefectSecret(secret_name)
and use that as the result