You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to control the pulumi execution context using environment variables.
There are several use cases where it is more convenient to have a PULUMI_STACK=my/stack pulumi preview instead of pulumi preview -s my/stack.
In an advanced use case the pulumi execution context in a CI/CD can be controlled using environment variables without having to explicitly pass the value as an argument.
At the same time, this approach can be extended to a local development environment by using direnv and a custom hook that both activate the AWS session (using assume or any other 3rd party tools) and exports (by reading a .env file) the appropriate pulumi stack to use.
Looks like golang has some "kind" of support for some envs, but I wasn't able to trigger it using my cli
$ pulumi stack
Please choose a stack, or create a new one: [Use arrows to move, type to filter]
my/stack_1
my/stack_2
><create a new stack>
$ PULUMI_STACK=my/stack_1 pulumi preview
Please choose a stack, or create a new one: [Use arrows to move, type to filter]
my/stack_1
my/stack_2
><create a new stack>
$ pulumi preview -s my/stack_1
# it works!
Any suggest?
Thanks so much.
Luca
The text was updated successfully, but these errors were encountered:
Currently the only "global" place the current stack is pulled from is in ~/.pulumi/workspaces, but that's not easy to write to (the folder names are all hashed).
It doesn't seem unreasonable to allow some config like this to be environment rather than just by settings files.
I fully agree. I was really surprised to find out that PULUMI_STACK is not a thing yet as it would make building things like github workflows a lot easier.
I would like to control the pulumi execution context using environment variables.
There are several use cases where it is more convenient to have a
PULUMI_STACK=my/stack pulumi preview
instead ofpulumi preview -s my/stack
.In an advanced use case the pulumi execution context in a CI/CD can be controlled using environment variables without having to explicitly pass the value as an argument.
At the same time, this approach can be extended to a local development environment by using direnv and a custom hook that both activate the AWS session (using assume or any other 3rd party tools) and exports (by reading a .env file) the appropriate pulumi stack to use.
Looks like golang has some "kind" of support for some envs, but I wasn't able to trigger it using my cli
$ pulumi preview -s my/stack_1 # it works!
Any suggest?
Thanks so much.
Luca
The text was updated successfully, but these errors were encountered: