You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
AWS_SDK_LOAD_CONFIG=1 AWS_SHARED_CREDENTIALS_FILE=/Users/e/.aws/credentials AWS_DEFAULT_PROFILE=default TF_LOG=debug bin/terraform-0.7.10/terraform plan
2016/11/09 15:31:49 [INFO] Terraform version: 0.7.10 fcf12bc46a34716652a5b9a4d7905361003293e7
2016/11/09 15:31:49 [INFO] CLI args: []string{"/Users/e/Dropbox/Dev/sagan/cloud-platform/bin/terraform-0.7.10/terraform", "plan"}
2016/11/09 15:31:49 [DEBUG] Detected home directory from env var: /Users/e
2016/11/09 15:31:49 [DEBUG] Detected home directory from env var: /Users/e
2016/11/09 15:31:49 [DEBUG] Attempting to open CLI config file: /Users/e/.terraformrc
2016/11/09 15:31:49 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2016/11/09 15:31:49 [DEBUG] Detected home directory from env var: /Users/e
2016/11/09 15:31:49 [WARN] Ignoring AWS metadata API endpoint at default location as it doesn't return any instance-id
2016/11/09 15:31:49 [DEBUG] plugin: waiting for all plugin processes to complete...
Error reloading remote state: AccessDenied: Access Denied
status code: 403, request id: 6E2C5E46C80CE049
Panic Output
N/A
Expected Behavior
We should be able to leverage the credentials stored in our ~/.aws/credentials.
Defining AWS_DEFAULT_PROFILE to a valid profile name (with non-expired STS tokens) should be adequate as that's all we need to set for the aws cli to work with AWS_SDK_LOAD_CONFIG is true and AWS_SHARED_CREDENTIALS_FILE is a valid path.
Actual Behavior
AccessDenied
Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
populate ~/.aws/credentials with current STS tokens:
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
locked and limited conversation to collaborators
Apr 19, 2020
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Terraform Version
I've tried downgrading to older
v0.7.x
with no success.Affected Resource(s)
Unable to use valid
profile
as defined in~/.aws/credentials
with the TFprovider
type ofaws
.https://www.terraform.io/docs/providers/aws/
Using
aws cli
with same profile & environment variables works fine.http://docs.aws.amazon.com/cli/latest/topic/config-vars.html
Terraform Configuration Files
I've tried using the below, both with and without expressing explicit
profile
that should be used.Debug Output
Panic Output
N/A
Expected Behavior
We should be able to leverage the credentials stored in our
~/.aws/credentials
.Defining
AWS_DEFAULT_PROFILE
to a valid profile name (with non-expired STS tokens) should be adequate as that's all we need to set for theaws cli
to work withAWS_SDK_LOAD_CONFIG
is true andAWS_SHARED_CREDENTIALS_FILE
is a valid path.Actual Behavior
AccessDenied
Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
populate
~/.aws/credentials
with current STS tokens:populate
~/.aws/config
to with appropriaterole_arn
mapped to profile in credentials.(make sure to update aws account id and role name)
Set the profile you want to use:
export AWS_DEFAULT_PROFILE=default
Verify
aws cli
happy to confirm proper configuration;aws ec2 describe-instances
(assuming you have "admin" privileges)Try running terraform plan:
terraform plan
Important Factoids
~/.aws/credentials
and~/.aws/config
(I renamed the dynamic profile names to justdefault
to reduce complexity;aws cli
happy /terraform
unhappy)References
AWS_ACCESS_KEY_ID
,AWS_SECRET_ACCESS_KEY
,AWS_SESSION_TOKEN
,AWS_SECURITY_TOKEN
)AWS_DEFAULT_REGION
andAWS_REGION
)AWS_SDK_LOAD_CONFIG
)The text was updated successfully, but these errors were encountered: