I have used terraform VPC module to create the VPC through Terragrunt. When i try to delete the VPC, it got hanged and throw EC2 Subnet (subnet-xxxxx): DependencyViolation error.
When i apply destroy command to delete the vpc, i got below.
module.vpc.aws_subnet.private[1]: Destroying... [id=subnet-xxxxx]
module.vpc.aws_subnet.private[0]: Destroying... [id=subnet-xxxxx]
Error: deleting EC2 Subnet (subnet-xxxxx): DependencyViolation: The subnet 'subnet-xxxxx' has dependencies and cannot be deleted.
β status code: 400, request id: 76947801-c590-4a79-bfdb-6468693133b8
β
β
β Error: deleting EC2 Subnet (subnet-xxxxx): DependencyViolation: The subnet 'subnet-xxxxx' has dependencies and cannot be deleted.
β status code: 400, request id: eaffa1e1-870d-43e3-a32a-434fffcd75ad
It got hanged in deleting the subnet. Above two subnets are private subnets.
Expected behavior
The plan is applied, deleting the VPC and associated subnets.
Actual behavior
It will say "Still destroying" for about 20 minutes, before it gives up saying the subnet has dependencies:
module.vpc.aws_subnet.private[2]: Destroying... [id=subnet-xxxxxx]
module.vpc.aws_subnet.private[1]: Still destroying... [id=subnet-xxxxx, 19m20s elapsed]
...
Error: deleting EC2 Subnet (subnet-xxxxx): DependencyViolation: The subnet 'subnet-xxxxx' has dependencies and cannot be deleted.
β status code: 400, request id: 76947801-c590-4a79-bfdb-6468693133b8
This issue has been automatically marked as stale because it has been open 30 days
with no activity. Remove stale label or comment or this issue will be closed in 10 days
Description
I have used terraform VPC module to create the VPC through Terragrunt. When i try to delete the VPC, it got hanged and throw EC2 Subnet (subnet-xxxxx): DependencyViolation error.
Versions
Module version [Required]:
Terragrunt version: v0.55.20
Provider version(s): registry.terraform.io/hashicorp/aws v5.42.0
Reproduction Code [Required]
When i apply destroy command to delete the vpc, i got below.
It got hanged in deleting the subnet. Above two subnets are private subnets.
Expected behavior
The plan is applied, deleting the VPC and associated subnets.
Actual behavior
It will say "Still destroying" for about 20 minutes, before it gives up saying the subnet has dependencies: module.vpc.aws_subnet.private[2]: Destroying... [id=subnet-xxxxxx] module.vpc.aws_subnet.private[1]: Still destroying... [id=subnet-xxxxx, 19m20s elapsed] ... Error: deleting EC2 Subnet (subnet-xxxxx): DependencyViolation: The subnet 'subnet-xxxxx' has dependencies and cannot be deleted. β status code: 400, request id: 76947801-c590-4a79-bfdb-6468693133b8