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

Do not require providerCredentialOpts Cluster parameter when using AWS_PROFILE #561

Merged
merged 5 commits into from
May 9, 2022

Conversation

t0yv0
Copy link
Member

@t0yv0 t0yv0 commented Apr 15, 2021

Proposed changes

Instead of failing AWS_PROFILE=foo pulumi up when providerCredentialOpts is not set, infer a reasonable value for this parameter automatically. This improves usability.

As you can see in pulumi/apps#4, as a user I start from an example that does not specify providerCredentialOpts, get a failure with a slightly confusing error message, set providerCredentialOpts={} and then pulumi preview and pulumi up succeed.

Digging a little deeper into why the error was there in the first place. This error check concerns itself with the usability of kubeconfig emitted from the Pulumi program. The kubeconfig JSON references how to log in to AWS; if providerCredentialOpts={} then it logs in using AWS CLI aws .., and if providerCredentialOpts={profileName: "foo"}, it logs in as aws --profile $foo. Now, it is not even strictly needed to specify --profile. If the user runs a shell session with export AWS_PROFILE=foo then both pulumi up and KUBECONFIG=<(pulumi stack output kubeconfig) kubectl get svc commands work just fine. The improvement of setting --profile its that the KUBECONFIG will be more resilient and will work in shells without AWS_PROFILE.

Related issues (optional)

pulumi/apps#4

@t0yv0 t0yv0 changed the title Infer provider credential opts from AWS_PROFILE rather than failing Do not require providerCredentialOpts Cluster parameter when using AWS_PROFILE Apr 15, 2021
@t0yv0 t0yv0 requested review from justinvp and stack72 April 15, 2021 20:35
@github-actions
Copy link

github-actions bot commented May 9, 2022

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

@stack72 stack72 merged commit 973916f into master May 9, 2022
@stack72 stack72 deleted the t0yv0/infer-provider-credential-opts-for-profile branch May 9, 2022 20:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants