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

Better error message with partial AWS config and credentials #1316

Closed
clstokes opened this issue Jan 21, 2021 · 0 comments · Fixed by pulumi/pulumi-terraform-bridge#326
Closed
Assignees
Labels
area/providers kind/enhancement Improvements or new features
Milestone

Comments

@clstokes
Copy link

Problem

If I provide partial AWS provider config (ie. only aws:region) and no credentials I get a confusing error message referring me to Terraform documentation.

p-aws-creds % pulumi config
KEY         VALUE
aws:region  us-east-1
p-aws-creds % pulumi up
Previewing update (dev)

View Live: https://app.pulumi.com/clstokes/p-aws-creds/dev/previews/33cfc380-1643-410e-960c-feabab4d43d2

     Type                 Name             Plan       Info
 +   pulumi:pulumi:Stack  p-aws-creds-dev  create
     └─ aws:s3:Bucket     my-bucket                   1 error

Diagnostics:
  aws:s3:Bucket (my-bucket):
    error: 1 error occurred:
    	* error configuring Terraform AWS Provider: no valid credential sources for Terraform AWS Provider found.

    Please see https://registry.terraform.io/providers/hashicorp/aws
    for more information about providing credentials.

    Error: NoCredentialProviders: no valid providers in chain. Deprecated.
    	For verbose messaging see aws.Config.CredentialsChainVerboseErrors


p-aws-creds %

If I provide no AWS configuration, I get a better error message:

p-aws-creds % pulumi config
KEY  VALUE
p-aws-creds % 
p-aws-creds % pulumi up
Previewing update (dev)

View Live: https://app.pulumi.com/clstokes/p-aws-creds/dev/previews/b35180b2-286b-4a0d-bf7d-aab823bd889b

     Type                 Name             Plan       Info
 +   pulumi:pulumi:Stack  p-aws-creds-dev  create
     └─ aws:s3:Bucket     my-bucket                   1 error

Diagnostics:
  aws:s3:Bucket (my-bucket):
    error: unable to discover AWS AccessKeyID and/or SecretAccessKey - see https://pulumi.io/install/aws.html for details on configuration


p-aws-creds %

Suggestions for a fix

Use the ... see https://pulumi.io/install/aws.html ... error message in the situation where the AWS provider is partially configured.

Steps to reproduce

  1. pulumi new aws-typescript -y
  2. pulumi up - with no AWS keys configured or available in your terminal or profile credentials file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/providers kind/enhancement Improvements or new features
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants