Do not require providerCredentialOpts Cluster parameter when using AWS_PROFILE #561
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Proposed changes
Instead of failing
AWS_PROFILE=foo pulumi up
whenproviderCredentialOpts
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 thenpulumi preview
andpulumi 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 CLIaws ..
, and ifproviderCredentialOpts={profileName: "foo"}
, it logs in asaws --profile $foo
. Now, it is not even strictly needed to specify--profile
. If the user runs a shell session withexport AWS_PROFILE=foo
then bothpulumi up
andKUBECONFIG=<(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