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

$AWS_PROFILE/$AWS_DEFAULT_PROFILE env vars not being honored #85

Closed
karl-barbour opened this issue Dec 21, 2016 · 2 comments
Closed

$AWS_PROFILE/$AWS_DEFAULT_PROFILE env vars not being honored #85

karl-barbour opened this issue Dec 21, 2016 · 2 comments

Comments

@karl-barbour
Copy link

As per issue #21

@brikis98 looks like I'm still having this issue.

[karl.barbour@xxx tf_poc]$ terragrunt apply
[terragrunt] 2016/12/21 15:04:13 Reading Terragrunt config file at .terragrunt
[terragrunt] 2016/12/21 15:04:13 Initializing remote state for the s3 backend
[terragrunt] 2016/12/21 15:04:13 Error finding AWS credentials (did you set the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables?): NoCredentialProviders: no valid providers in chain. Deprecated. 
	For verbose messaging see aws.Config.CredentialsChainVerboseErrors
[karl.barbour@xxx tf_poc]$ echo $AWS_DEFAULT_PROFILE 
poc-account
[karl.barbour@xxx tf_poc]$ echo $AWS_PROFILE 
poc-account

As you can see, the env vars are working.

Versions:
terragrunt 0.7.1
aws-cli 1.10.47
Darwin 15.5.0

Any ideas?

With these ENV vars set, I can use the CLI fine (i.e. aws ec2 describe-instances), so it doesn't appear to be a credential issue.

@karl-barbour karl-barbour changed the title AWS_PROFILE/AWS_DEFAULT_PROFILE not being honored $AWS_PROFILE/$AWS_DEFAULT_PROFILE env vars not being honored Dec 21, 2016
@brikis98
Copy link
Member

Out of curiosity, what happens if you run terraform plan directly with the exact same env vars and profile?

@karl-barbour
Copy link
Author

@brikis98 yes, it worked fine at the time (apologies - I should have mentioned).

This may be environmental (to me) as I have now managed to make it work by creating a completely new OS X profile. I'll mark this as closed again but if anybody else sees the issue in future please do raise a new issue.

For reference, https://www.terraform.io/docs/providers/aws/index.html mentions the following:

Shared Credentials file

You can use an AWS credentials file to specify your credentials. The default location is $HOME/.aws/credentials on Linux and OS X, or "%USERPROFILE%.aws\credentials" for Windows users. If we fail to detect credentials inline, or in the environment, Terraform will check this location. You can optionally specify a different location in the configuration by providing the shared_credentials_file attribute, or in the environment with the AWS_SHARED_CREDENTIALS_FILE variable. This method also supports a profile configuration and matching AWS_PROFILE environment variable:

Usage:

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants