Frederik Hagelund
07/07/2022, 7:58 AMprha
07/07/2022, 4:51 PMStephen Bailey
07/07/2022, 5:25 PMcommon
submodule. Within that we set a CURRENT_WORKSPACE
variable as os.getenv("DAGSTER_WORKSPACE", "dev")
.
Then, in our job code, we can do things like
from my_repo.common import CURRENT_WORKSPACE
if CURRENT_WORKSPACE == "prod":
my_secret = fetch_secret("foo")
else:
my_secret = "bar"
I tried to manage all our secrets via the environment initially, but it was cumbersome. So now, i just make sure our prod and stage deployments have DAGSTER_WORKSPACE set and the code handles the rest