jckuester / awsweeper

A tool for cleaning your AWS account
Mozilla Public License 2.0
467 stars 45 forks source link

Error: failed to configure provider (name=aws, version=3.16.0): #120

Closed thenervousgeek closed 3 years ago

thenervousgeek commented 3 years ago

While performing awsweeper --profile myaccount --dry-run config.yml I get this error (see the at the bottom):

This is how I set the default-region: export AWS_DEFAULT_REGION=us-west-2

vi myaccount has this format:

provider "aws" {
  region     = "us-west-2"
  access_key = "my-access-key"
  secret_key = "my-secret-key"
}

vi config.yml is just a list of these aws resources:

aws_vpc:
aws_iam_role:
aws_instance:

Error: failed to configure provider (name=aws, version=3.16.0): 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

thenervousgeek commented 3 years ago

it was the profile that was not correctly working. You can delete this "non-issue".