Skip to content

Commit

Permalink
make the providerCredentialOpts error clearer
Browse files Browse the repository at this point in the history
  • Loading branch information
jaxxstorm committed Apr 15, 2021
1 parent 95c46c4 commit 2c3b785
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions nodejs/eks/cluster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1379,15 +1379,15 @@ export class Cluster extends pulumi.ComponentResource {
// Check that AWS provider credential options are set for the kubeconfig
// to use with the given auth method.
if (opts?.provider && !args.providerCredentialOpts) {
throw new Error("providerCredentialOpts and an AWS provider instance must be set together");
throw new Error("It looks like you're using an explicit AWS provider. Please specify this provider in providerCredentialOpts. For more details, see here: https://www.pulumi.com/docs/reference/pkg/nodejs/pulumi/eks/#ClusterOptions-providerCredentialOpts")
}
if (process.env.AWS_PROFILE && !args.providerCredentialOpts) {
throw new Error("providerCredentialOpts and AWS_PROFILE must be set together");
throw new Error("It looks like you're using AWS profiles. Please specify this profile in providerCredentialOpts. For more details, see here: https://www.pulumi.com/docs/reference/pkg/nodejs/pulumi/eks/#ClusterOptions-providerCredentialOpts");
}
const awsConfig = new pulumi.Config("aws");
const awsProfile = awsConfig.get("profile");
if (awsProfile && !args.providerCredentialOpts) {
throw new Error("providerCredentialOpts and AWS config setting aws:profile must be set together");
throw new Error("It looks like you've set an AWS profile in your stack config. Please specify this profile providerCredentialOpts. For more details, see here: https://www.pulumi.com/docs/reference/pkg/nodejs/pulumi/eks/#ClusterOptions-providerCredentialOpts")
}

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

0 comments on commit 2c3b785

Please sign in to comment.