Terraform version 0.11.11 on Ubuntu 16.04
gives the following error
$ AWS_PROFILE=marcus terraform init
Initializing modules...
- module.vpc
Initializing the backend...
Error configuring the backend "s3": 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
Please update the configuration in your Terraform files to fix this error.
If you'd like to update the configuration interactively without storing
the values in your configuration, run "terraform init".
AWS config file
[default]
output = json
region = eu-west-2
[profile marcusa]
role_arn = arn:aws:iam::xxxxxxxxxxxxx:role/marcusa
source_profile = default
region = us-east-1
output = json
credentials
[default]
aws_access_key_id = xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
aws_secret_access_key = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
following some of the suggestions in #18402
I tried
AWS_SDK_LOAD_CONFIG=1 AWS_PROFILE=marcus terraform init
this then works ok.
I have confirmed with 0.11.13 that this is still an issue. Can we get some traction on fixing this once and for all? The previous bug and PR did NOT fix the issue.
Setting AWS_PROFILE during init doesn't work for me. I get following error:
Error configuring the backend "s3": NoCredentialProviders: no valid providers in chain. Deprecated.
For verbose messaging see aws.Config.CredentialsChainVerboseErrors
I don't have credential file in .aws folder. Instead I have assumed role something like this in my config file
[profile okta-sandbox-proxy]
credential_process = aws-okta exec okta-sandbox -- cmd /c C:\tools\proxy-aws-okta-result.bat
region = us-west-2
[profile okta-sandbox]
aws_saml_url = home/amazon_aws/0oahmb006mRgL5aHI0x7/272
role_arn = arn:aws:iam::XXXXXXXXXX:role/VA-Role-Devops-L3
region = us-west-2
Not sure what the alternate solution is. Anybody can suggest the alternate solution to create s3 backend until main issue gets fixed.
It's just working if I use AWS_PROFILE=<my_profile> terraform init with S3 Backend.
This issue was reported many times and the terraform team is ignoring it, causing repeated problem report.
Just my $0.02
I was receiving Error: Invalid AWS Region: when I was using s3 for state and forgot to add -backend-config="bucket=<terraform-bucket-state>" -backend-config="region=<region>"
doing a terraform 12.5 -> 12.23 required the backend to be re-initialized
It was a little annoying that it didn't flag the error was related to the s3 bucket
Multiple fixes for credential ordering, automatically using the AWS shared configuration file if present, and profile configuration handling of the S3 Backend have been merged and will release with version 0.13.0-beta2 of Terraform.
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.
Most helpful comment
I have confirmed with 0.11.13 that this is still an issue. Can we get some traction on fixing this once and for all? The previous bug and PR did NOT fix the issue.