Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI environment variable to define the default Pulumi organization #16379

Open
ringods opened this issue Jun 12, 2024 · 5 comments
Open

CLI environment variable to define the default Pulumi organization #16379

ringods opened this issue Jun 12, 2024 · 5 comments
Labels
area/cli UX of using the CLI (args, output, logs) kind/enhancement Improvements or new features

Comments

@ringods
Copy link
Member

ringods commented Jun 12, 2024

Hello!

  • Vote on this issue by adding a 👍 reaction
  • If you want to implement this feature, comment to let us know (we'll work with you on design, scheduling, etc.)

Issue details

Customer is asking for an environment variable that defines the default Pulumi organization to work against.

Direct feedback from the customer:

Use case would be a simpler user experience where the user doesn't have to use fully qualified stack names while still being able to work in different organizations from different repositories. We're currently using direnv to set many environment variables in every repo anyway so that would be really neat. Currently we're calling pulumi org set-default <org-name> in that direnv script. But that setting is global so one cannot easily work in parallel in two terminals working in different "default"

The value of the environment variable should not be persisted to Pulumi's local config file. This is to prevent another case like #13919

Affected area/feature

Pulumi CLI, environment variables, multiple shell sessions

@ringods ringods added kind/enhancement Improvements or new features needs-triage Needs attention from the triage team labels Jun 12, 2024
@Frassle Frassle added area/cli UX of using the CLI (args, output, logs) and removed needs-triage Needs attention from the triage team labels Jun 12, 2024
@Frassle
Copy link
Member

Frassle commented Jun 12, 2024

Just something like PULUMI_ORG/PULUMI_ORGANIZATION?

@ringods
Copy link
Member Author

ringods commented Jun 12, 2024

@Frassle yes. I prefer the full word, so PULUMI_ORGANIZATION

@joeduffy
Copy link
Member

joeduffy commented Jun 15, 2024

I would suggest PULUMI_DEFAULT_ORGANIZATION instead; simply having PULUMI_ORGANIZATION makes me think that it's going to unilaterally use that organization, when in reality it is just setting the default used when not explicitly passed.

Also, what takes precedence if the end user also supplied pulumi org set-default <org-name>?

@tobiashenkel
Copy link

From end user point of view I would expect the environment variable to take precedence over pulumi org set-default <org-name>. This would be important in our direnv based workflow as this aims to make the deployment scripts as independent as possible from individual user configuration.

@AaronFriel
Copy link
Member

AaronFriel commented Jun 17, 2024

We recently shipped PULUMI_ORGANIZATION as an env var in Pulumi YAML:

https://github.com/pulumi/pulumi-yaml/pull/578/files#diff-104a11712684e520f0affa95e6a053faeb713306a10f69ee99b9729cc9dd1996R134

Likely do not want to conflict with that, so 👍 to Joe's comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cli UX of using the CLI (args, output, logs) kind/enhancement Improvements or new features
Projects
None yet
Development

No branches or pull requests

5 participants