Or is there a way to access environment variables ...
# general
t
Or is there a way to access environment variables in your code instead the config values from the environment?
f
I have done horrible horrible things to environment variables. Node's process.env and Python's OS.environ should both work beautifully - what language are you using?
t
Python. Sorry “environment” might be confusing. I’m referring to the pulumi esc https://www.pulumi.com/docs/esc/
s
That will depend on your ESC configuration, I'd say. Generally, you'd use the
pulumiConfig
option in the ESC definition, which means you have to pull them from the Pulumi configuration.
ESC can expose environment information as environment variables, but that doesn't integrate directly with the
pulumi
CLI (you end up having to do
esc run pulumi <operation>
I believe).
t
Right. I am doing something like
client_id = config.require("azure_client_id")
but the client id doesn’t change from stack to stack. However I need to reference it in the code. I saw a PR on github. Maybe it’ll come one day.
s
I might be missing something here. You can do what you're describing with ESC and the
pulumiConfig
keyword today, using exactly the code you've shared above. Is this not working for you?
t
No it totally works. What I want to do is set the environment in the Pulumi.yaml file instead of the Pulumi.stackname.yaml file.
s
Ah. Yeah, you can't do that yet, AFAIK.