Hey, Does the Pulumi automation API propogate env ...
# automation-api
c
Hey, Does the Pulumi automation API propogate env vars from the shell running the wrapper program to the Pulumi CLI RPC? It seems like it might not? Is there a way to do this? e.g. create a workspace with the same env as the process creating the workspace? to give a simple example. If the user sets
AWS_PROFILE
and them runs main.go which runs Pulumi using the automation API, I want the program to run with that profile
best way I found to do this so far is to get the env vars with
os.Environ()
and insert them into the local workspace when creating it
s
That’s the same technique I use; I don’t know if there’s a “better” way of doing it.
c
Thanks, I can't get it to see the configuration set (in a file) by
gcloud config set
. Do you know of a solution for that?
s
I don’t know of a solution other than to
os.Exec
the
gcloud
command you need and parse the output, which is a hack at best but might work.
c
thanks! that's what I implemented 🙂
s
LOL 😄