Terraform: Support tilde '~' in shared credentials path for providers

Created on 18 Jan 2017  ยท  3Comments  ยท  Source: hashicorp/terraform

Terraform Version

v.0.8.2

Affected Resource(s)

  • aws provider

Terraform Configuration Files

provider "aws" {
  region                   = "us-west-2"
  shared_credentials_file  = "~/.aws/creds"
  profile                  = "customprofile"
}

Expected Behavior

Evaluate to my $HOME, and then use the aws creds file from there. This would be nice in a team environment so we don't have usernames hardcoded.

Workaround is a wrapper script for this, but this would be nice as an enhancement.

enhancement provideaws

Most helpful comment

Hi @joshlove, thanks for the issue!

I've submitted #11277, which should allow you to use the pathexpand() interpolation function inside your provider config, and elsewhere.

provider "aws" {
  region                   = "us-west-2"
  shared_credentials_file  = "${pathexpand(~/.aws/creds)}"
  profile                  = "customprofile"
}

All 3 comments

Hi @joshlove, thanks for the issue!

I've submitted #11277, which should allow you to use the pathexpand() interpolation function inside your provider config, and elsewhere.

provider "aws" {
  region                   = "us-west-2"
  shared_credentials_file  = "${pathexpand(~/.aws/creds)}"
  profile                  = "customprofile"
}

Appreciate your work on this, thanks!

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

glenjamin picture glenjamin  ยท  112Comments

phinze picture phinze  ยท  86Comments

felnne picture felnne  ยท  133Comments

FlorinAndrei picture FlorinAndrei  ยท  61Comments

radeksimko picture radeksimko  ยท  80Comments