-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
terraform and vault: provider.aws: InvalidClientTokenId: The security token included in the request is invalid. #1086
Comments
Could this be the cause: hashicorp/terraform#2972 (comment) ? |
I strongly suspect now this is due to IAM keys being eventually consistent, but Vault doesn't wait or check. So probably not a Terraform bug. hashicorp/vault#3115 |
This is actually due to the last credentials fetched from vault being used for interpolation. |
I'm not using vault and I'm hitting this same problem. My access-key and secret are, for now, just hardcoded in https://github.com/llevar/butler/blob/master/examples/deployment/aws/large-cluster/vars.tf The actual error after substituting the access key and secret is:
The only "unusual characters" that my Furthermore, I just tried substituting those credentials for dummy My current terraform version is:
And the aws provider was downloaded via the usual
|
@brainstorm This seems rather unrelated to this issue unless you actually used fresh new IAM keys. |
I ran into this issue and resolved it with -var-file option that pointed to my tfvars file with credential. This issue does not trigger if one is using credentials with environment parameter. |
Hi @AnthonyWC : There are many ways to get AWS keys into a Terraform plan. The particular issue raised by @FlorinAndrei focuses on the issue that if you dynamically generated short-lived AWS credentials with Vault using Terraform's Vault Provider and vault_generic_secret data source to read from the AWS secrets backend in Vault, the AWS keys that were just created are not yet available from all AWS API endpoints. He provided a workaround in hashicorp/terraform#2972 (comment). |
Marking this issue as stale due to inactivity. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 30 days it will automatically be closed. Maintainers can also remove the stale label. If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you! |
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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
Terraform Version
0.9.11
Affected Resource(s)
Terraform Configuration Files
Debug Output
I am watching the traffic between Terraform and Vault with tcpdump, since it's plain text.
I see the AWS keys, generated by Vault, being returned to Terraform in JSON format.
I know the AWS key generator in Vault works fine because I've tested it with the command line, and the keys it returns are working just fine. The keys are generated with admin privileges, for testing, and so they should be able to do anything.
Expected Behavior
terraform plan
should succeed.Actual Behavior
Steps to Reproduce
terraform plan
The text was updated successfully, but these errors were encountered: