error waiting for EC2 Internet Gateway (igw-xxx) to detach from VPC (vpc-xxx): unexpected state 'available', wanted target ''. last error: %!s(<nil>) #21792
Labels
bug
Addresses a defect in current functionality.
regression
Pertains to a degraded workflow resulting from an upstream patch or internal enhancement.
service/ec2
Issues and PRs that pertain to the ec2 service.
Milestone
Community Note
Terraform CLI and Terraform AWS Provider Version
terraform version - 0.13.7
aws provider version - 3.65.0
Affected Resource(s)
Terraform Configuration Files
Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.
Unfortunately I can only include the relevant fragment of the bigger config.
Debug Output
Panic Output
NA
Expected Behavior
IGW should be succesfully deleted
Actual Behavior
After upgrading to aws provider version 3.65.0 from 3.62.0 we started to notice occasional errors in IGW removal during Terraform destroy, this causes stops destroy process and results in some orphan resources, e.g. VPC. This now occurs once/twice per our test suite which consists of approximately 100 test cases.
I briefly analysed the source code and build logs and noticed there were some changes in the IGW resource code. There are 2 things that I found interesting:
In the resource code I see:
but there is no handling for this error:
As I understand the expectation is that the IGW is either not found or has an attachment with empty State:
Note that I ran CLI and prvider uses GO client so the outputs may differ
Steps to Reproduce
Unfortunately the issue is non-deterministic and happens only from time to time, however after the upgrade I get it once/twice per test suite, before that i used to get sporadically (I saw that only few times over past few months)
Important Factoids
I would expect longer timeout plus seems that AWS may return different status messages for multiple runs of the same scenario
References
The text was updated successfully, but these errors were encountered: