Skip to content

S3 Backend doesn't pick up role from profiles #19482

@estahn

Description

@estahn

Terraform Version

Terraform v0.11.10
+ provider.aws v1.48.0
+ provider.github v1.3.0

Terraform Configuration Files

Non-working example:

terraform {
  backend "s3" {
    bucket         = "xxx"
    key            = "projects/xxx.tfstate"
    region         = "ap-southeast-2"
    dynamodb_table = "terraform_locks"
    kms_key_id     = "arn:aws:kms:ap-southeast-2:xxx:key/xxx"
    profile = "default"
  }
}

Working example:

terraform {
  backend "s3" {
    bucket         = "xxx"
    key            = "projects/xxx.tfstate"
    region         = "ap-southeast-2"
    dynamodb_table = "terraform_locks"
    kms_key_id     = "arn:aws:kms:ap-southeast-2:xxx:key/xxx"
    profile = "default"
    shared_credentials_file = "$HOME/.aws/credentials"
  }
}

Debug Output

Crash Output

Expected Behavior

I should be able to omit shared_credentials_file and terraform should pick up the role configuration from $HOME/.aws/config.

Actual Behavior

Authentication fails.

Steps to Reproduce

  1. terraform init

Additional Context

References

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions