DependencyViolation when deleting security group associated to lambda and vpc_endpoint #16165
Labels
bug
Addresses a defect in current functionality.
crash
Results from or addresses a Terraform crash or kernel panic.
service/ec2
Issues and PRs that pertain to the ec2 service.
service/lambda
Issues and PRs that pertain to the lambda service.
Milestone
This issue was originally opened by @pnandita as hashicorp/terraform#26892. It was migrated here as a result of the provider split. The original body of the issue is below.
Description:
Create 2 lambdas in terraform. Each lambda will have its own security group. Also create a VPC endpoint with a security group of it’s own. Add the lambda security groups as an ingress into vpc_endpoint’s security group. Now, delete one of the lambda it’s associated security group, and also remove the reference from the ingress rules from vpc_endpoint. This results in a dependency violation, and the lambda security group never ends up getting deleted and fails with the error:
aws_security_group.lambda_sg2: Still destroying... [id=sg-xxxxx, 19m41s elapsed]
aws_security_group.lambda_sg2: Still destroying... [id=sg-xxxxx, 19m51s elapsed]
Error: Error deleting security group: DependencyViolation: resource sg-xxxx has a dependent object
status code: 400, request id: xxxx-xxx-xx-xx-xxxxx
Terraform Version
Terraform Configuration Files
Debug Output
Crash Output
Expected Behavior
Should be able to delete the lambda and security group when removed from terraform.
Actual Behavior
The security group never gets deleted due to a Dependency violation:
Steps to Reproduce
The text was updated successfully, but these errors were encountered: