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

Error: No valid credential sources found for AWS Provider. #24768

Closed
florin-waterford opened this issue Apr 26, 2020 · 3 comments
Closed

Error: No valid credential sources found for AWS Provider. #24768

florin-waterford opened this issue Apr 26, 2020 · 3 comments

Comments

@florin-waterford
Copy link

florin-waterford commented Apr 26, 2020

Terraform randomly fails to read the AWS credentials from ~/.aws.

Terraform Version

Terraform v0.12.24

(macOS 10.15)

Terraform Configuration Files

variable "account" {
  default = "123123123123"
}

variable "region" {
  default = "eu-east-1"
}

variable "bucket-region" {
  default = "us-east-1"
}

Debug Output

$ terraform init

2020/04/26 18:20:39 [INFO] Terraform version: 0.12.24  
2020/04/26 18:20:39 [INFO] Go runtime version: go1.13.8
2020/04/26 18:20:39 [INFO] CLI args: []string{"/usr/local/bin/terraform", "init"}
2020/04/26 18:20:39 [DEBUG] Attempting to open CLI config file: /Users/USER/.terraformrc
2020/04/26 18:20:39 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2020/04/26 18:20:39 [INFO] CLI command args: []string{"init"}
2020/04/26 18:20:39 [TRACE] ModuleInstaller: installing child modules for . into .terraform/modules
Initializing modules...
2020/04/26 18:20:39 [DEBUG] Module installer: begin module1
2020/04/26 18:20:39 [TRACE] ModuleInstaller: Module installer: module1 <nil> already installed in ../modules/module1
2020/04/26 18:20:39 [TRACE] modsdir: writing modules manifest to .terraform/modules/modules.json

Initializing the backend...
2020/04/26 18:20:39 [TRACE] Meta.Backend: built configuration for "s3" backend with hash value 782968548
2020/04/26 18:20:39 [TRACE] Meta.Backend: backend has not previously been initialized in this working directory
2020/04/26 18:20:39 [DEBUG] New state was assigned lineage "12312312-1231-1231-1231-123123123123"
2020/04/26 18:20:39 [TRACE] Meta.Backend: moving from default local state only to "s3" backend
2020/04/26 18:20:39 [INFO] Setting AWS metadata API timeout to 100ms
2020/04/26 18:20:40 [INFO] Ignoring AWS metadata API endpoint at default location as it doesn't return any instance-id
2020/04/26 18:20:40 [INFO] Attempting to use session-derived credentials

Error: No valid credential sources found for AWS Provider.
        Please see https://terraform.io/docs/providers/aws/index.html for more information on
        providing credentials for the AWS Provider

Expected Behavior

It should read credentials from ~/.aws.

Actual Behavior

It can't find the credentials.

Steps to Reproduce

terraform init

Additional Context

This breaks every once in a while. I'm not sure when. Removing the .terraform directory doesn't help. Reinstalling Terraform doesn't fix it. It works if I copy the working project in another directory and run terraform init, it works, but I'd rather not do that every time TF breaks.

Setting the AWS_PROFILE, AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables fixes this, but it should not be needed.

@danieldreier
Copy link
Contributor

@florin-waterford I'm going to categorize this as an enhancement request for the AWS Terraform provider, rather than in core. The HashiBot will shortly migrate it over to the AWS provider.

@ghost
Copy link

ghost commented Apr 28, 2020

This issue has been automatically migrated to hashicorp/terraform-provider-aws#13057 because it looks like an issue with that provider. If you believe this is not an issue with the provider, please reply to hashicorp/terraform-provider-aws#13057.

@ghost ghost closed this as completed Apr 28, 2020
@ghost
Copy link

ghost commented May 28, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators May 28, 2020
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants