Skip to content

Commit

Permalink
Do not require providerCredentialOpts Cluster parameter when using AW…
Browse files Browse the repository at this point in the history
…S_PROFILE (#561)

Co-authored-by: Paul Stack <public@paulstack.co.uk>
  • Loading branch information
t0yv0 and stack72 committed May 9, 2022
1 parent 76c0172 commit 973916f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@
- Upgrade Pulumi dependencies
[#589](https://github.com/pulumi/pulumi-eks/pull/589)

### Improvements

- Do not require providerCredentialOpts Cluster parameter when using AWS_PROFILE
[#561](https://github.com/pulumi/pulumi-eks/pull/561)

## 0.30.0 (Released April 19, 2021)

- Upgrade Pulumi dependencies to 3.0 releases
Expand Down
8 changes: 6 additions & 2 deletions nodejs/eks/cluster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1392,12 +1392,16 @@ export class Cluster extends pulumi.ComponentResource {
throw new Error("It looks like you're using an explicit AWS provider. Please specify this provider in providerCredentialOpts.");
}
if (process.env.AWS_PROFILE && !args.providerCredentialOpts) {
throw new Error("It looks like you're using AWS profiles. Please specify this profile in providerCredentialOpts.");
args.providerCredentialOpts = {
profileName: process.env.AWS_PROFILE,
};
}
const awsConfig = new pulumi.Config("aws");
const awsProfile = awsConfig.get("profile");
if (awsProfile && !args.providerCredentialOpts) {
throw new Error("It looks like you've set an AWS profile in your stack config. Please specify this profile in providerCredentialOpts.");
args.providerCredentialOpts = {
profileName: awsProfile,
};
}

// Create the core resources required by the cluster.
Expand Down

0 comments on commit 973916f

Please sign in to comment.