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

shared_credentials_file for aws provider does not expand ~/<path> #6193

Closed
tmulhern3 opened this issue Apr 15, 2016 · 3 comments
Closed

shared_credentials_file for aws provider does not expand ~/<path> #6193

tmulhern3 opened this issue Apr 15, 2016 · 3 comments

Comments

@tmulhern3
Copy link

The aws provider does not expand the user's home directory ~/ for the shared_credentials_file argument. See below:

provider "aws" { shared_credentials_file = "~/.aws/credentials" profile = "Profile" region = "${var.region}" }

Error message: No valid credential sources found for AWS Provider.

Please note that and error does not occur when supplying the full path instead of ~/.

If this issue appears to affect multiple resources, it may be an issue with Terraform's core, so please mention this.

This appears to have happened in the past as well: - GH-3856

@fgimian
Copy link

fgimian commented Oct 9, 2016

Would really love to see this too as it would make it easier for multiple team members to run Terraform without having to modify this path to suit their home directory. For now, perhaps using the AWS_SHARED_CREDENTIALS_FILE environment variable is the best way to go.

@Techbrunch
Copy link
Contributor

This issue looks like a duplicate of #11268, it also looks like it was fixed in #11277.

According to the documentation:

pathexpand(string) - Returns a filepath string with ~ expanded to the home directory. Note: This will create a plan diff between two different hosts, unless the filepaths are the same.

So it should be possible to do this:

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

@ghost
Copy link

ghost commented Apr 11, 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 Apr 11, 2020
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

6 participants