I have my credentials in my ~/.aws/credentials file and I can use aws cli perfectly fine but when I do a terraform init I get the following error:

Error initializing new 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
then run this command again.

By default if i dont specify my credentials on backend.tf it should look in ~/.aws/credentials by default.Not sure what the issue is. i have double checked the access and nohing has changed.

Terraform version: Terraform v0.11.11

My backed.tf looks like this:

terraform {
  backend "s3" {
    bucket = "ms14terraform"
    key    = "path/to/my/key/terraform.tfstate"
    dynamodb_table = "terraform-state-lock-dynamo"
    region = "eu-west-1"

this is on my ubuntu machine


seems like this was an issue due to the snap install on ubuntu, direct download from the terraform website seemed to fix the issue: download link


In the backed.tf, you mentioned terraform as the bucket name, are you sure you owned this bucket? As S3 bucket name is global and unique. Can you please update the configuration with the bucket you owned.

bucket - (Required) The name of the S3 bucket.

For more info please refer this doc https://www.terraform.io/docs/backends/types/s3.html

  • apologies, i substituted the bucket name for a generic one for this post, i have updated the question – user3412172 Feb 25 at 9:12
  • also i think this is down to the version of terraform maybe – user3412172 Feb 25 at 9:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.