When removing the security group along the rules referencing it, at first the rules should be deleted, then the group. Dependent resource must be updated to be independent from dependency before its dependency could be destroyed.
During this operation, if terraform triggers a request which results in an HTTP 400 response from AWS API - the operation should be cancelled and considered failed.
Actual Behavior
Terraform tries to destroy the security group before removing the rules referencing it, and stucks in a loop receiving HTTP 400 from AWS for continuously retrying incorrect requests.
Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.
Volunteering to Work on This Issue
If you are interested in working on this issue, please leave a comment.
If this would be your first contribution, please review the contribution guide.
Terraform Core Version
1.3.7
AWS Provider Version
4.51.0
Affected Resource(s)
aws_security_group
Expected Behavior
HTTP 400
response from AWS API - the operation should be cancelled and considered failed.Actual Behavior
Terraform tries to destroy the security group before removing the rules referencing it, and stucks in a loop receiving HTTP 400 from AWS for continuously retrying incorrect requests.
Relevant Error/Panic Output Snippet
No response
Terraform Configuration Files
Initial state:
Target state:
Steps to Reproduce
Debug Output
No response
Panic Output
No response
Important Factoids
No response
References
Similar issue - #265, it points on a wrong (IMO) facts, and contains a long discussion with some unrelated things, so I decided to start a new one.
Would you like to implement a fix?
None