Open dedeen opened 1 year ago
Voting for Prioritization
Volunteering to Work on This Issue
I've found that this also happens on refresh occasionally, and retrying the refresh typically works around the issue.
Hey @dedeen π Thank you for taking the time to raise this! Based on the error, it seems like the credentials being used to authenticate the AWS provider are becoming invalid. With that and that you mentioned you're running in Cloudshell, I'm wondering if your Cloudshell session is timing out due to user inactivity (running processes like Terraform won't count as user activity). That would also explain why this seems to occur when using for_each
or refreshes -- things that can wind up making plans and applies run a little longer at times.
Hi Justin, Thanks for taking a look. I'm pretty sure that my session isn't timing out as I am watching the output of the apply in real time and the build only takes a few minutes. I can up-arrow and rerun the script, sometimes it completes without issue the second or third time.
Hey @dedeen π Thank you for the update. If possible, can you supply full debug logs (redacted as needed) as well?
Hi, The debug logs are at this link (noted on the original bug). Please let me know if you need additional information. https://gist.github.com/dedeen/bf1c23cd2cd8d29ecd0a1fa0ff6d8e0c
Hi @dedeen, the debug log is cut off. Could you please include the full log from the beginning?
Also, what happens if you don't use for_each
, but call the module twice, once for each item in oregon_dcs
?
Terraform Core Version
v1.3.6
AWS Provider Version
v4.46.0
Affected Resource(s)
When using for_each over variable.tf file, the aws_vpc module fails intermittently to either apply or destroy a VPC. The error indicates: Sign Request ec2/CreateSubnet failed, not retrying, error failed to refresh cached credentials, failed to load credentials, deserialization failed, failed to decode error message, EOF.
This doesn't happen if not using for_each.
The failure is intermittent, and rerunning either the apply or destroy usually works correctly.
Expected Behavior
VPC should be created, with private and public subnet, IGW, NATGW.
Actual Behavior
If building (applying), some parts of VPC are built. Rerunning typically builds those parts that failed. On destroy, VPC deletion fails, and rerunning typically works.
Relevant Error/Panic Output Snippet
Terraform Configuration Files
main.tf
vars.tf
provider.tf
Steps to Reproduce
Debug Output
Panic Output
No response
Important Factoids
The problem only occurs for me running for_each, as shown in the attached scripts.
References
https://gist.github.com/dedeen/bf1c23cd2cd8d29ecd0a1fa0ff6d8e0c
Would you like to implement a fix?
None