Closed slackfan closed 2 months ago
Voting for Prioritization
Volunteering to Work on This Issue
Reading the documentation https://registry.terraform.io/providers/hashicorp/aws/latest/docs#duration I am more confused than before. The documentation indeed mentions that there is a timeout, but it does not mention if there is an auto-renewal of the session (as needed) or not. I am also relatively certain that the exception is new behavior.
The 15 minute duration between the start and end of your logs is suspicious. The AssumeRole API takes a configurable duration. Although it defaults to 3600 seconds (1 hour), the minimum it can be set to is 900 seconds (15 minutes). How is the docker container assuming the role and ensuring that it refreshes credentials if required?
Hey @slackfan 👋 I wanted to check in here to see if you're still having troubles. If so, are you able to provide any details around what Matthew asked above?
Hello. I found this issue occurs if you have multiple instances of logins defined in your aws credentials file. An example; I have AWS credentials that get minted under my "default" profile. However, I want to apply a module to a different account using a different credentials file, called "dev". I used the default configuration to provision a backend S3 bucket for "dev"'s state using my "Default" credentials, but then define the objects using the "dev" credentials for provisioning the actual resources.
When either one of the session tokens are invalidated, the following error is thrown. Even though my "default" credentials weren't needed to change dev's state, the fact that both the credentials for "dev" and "default" were in ~/.aws/credentials means both needed to evaluate as valid for one set of credentials to be used.
Hope this helps.
Given the information above, this appears to be behaving as I would expect. Since we've not heard back otherwise, I'm going to close this issue. If you have any further issues with the provider, please do let us know!
[!WARNING] This issue has been closed, meaning that any additional comments are hard for our team to see. Please assume that the maintainers will not see them.
Ongoing conversations amongst community members are welcome, however, the issue will be locked after 30 days. Moving conversations to another venue, such as the AWS Provider forum, is recommended. If you have additional concerns, please open a new issue, referencing this one where needed.
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.
Terraform Core Version
1.5.4
AWS Provider Version
5.10.0
Affected Resource(s)
IAM Session handling of the AWS Provider.
Expected Behavior
The issue does not occur.
Actual Behavior
Sporadically and since some weeks, not easily reproducible but constantly we see the issue
ExpiredTokenException: The security token included in the request is
while the AWS provider logic waits for resources being created. This may be EKS clusters or EKS Node group resources.Relevant Error/Panic Output Snippet
Terraform Configuration Files
I am not sure what is needed here. The setup is terraform code in a docker container, running on an EC2 Instance. The terraform code uses the assume_role feature of the AWS provider and executes using that dedicated given IAM role.
Steps to Reproduce
(re-)create resources which require potentially more than 15 min for being done.
Debug Output
I have a full log with TRACE log level available, but I cannot easily share it on Github, so...
Panic Output
No response
Important Factoids
No response
References
No response
Would you like to implement a fix?
No