f5devcentral / terraform-modular-demo-framework

Apache License 2.0
5 stars 3 forks source link

AWS VPC site reported as destroyed masking destroy failure #27

Open mjmenger opened 1 year ago

mjmenger commented 1 year ago

while running terragrunt run-all destroy, the aws-appstack-site-1 module reported a successful destruction. When terragrunt subsequently tried to destroy aws-base-1, an error was returned that its subnets still had dependencies.

aws_subnet.f5-xc-services-internal["az1"]: Still destroying... [id=subnet-0758b315fde555be2, 20m0s elapsed]
╷
│ Error: deleting EC2 Subnet (subnet-0758b315fde555be2): DependencyViolation: The subnet 'subnet-0758b315fde555be2' has dependencies and cannot be deleted.
│       status code: 400, request id: 4c3bd14a-9062-4e9b-93e7-da6dd8e78dce
│ 
│ 
╵
╷
│ Error: deleting EC2 Internet Gateway (igw-0193033119e7a8755): error detaching EC2 Internet Gateway (igw-0193033119e7a8755) from VPC (vpc-0d67cd6e2397f6d6f): DependencyViolation: Network vpc-0d67cd6e2397f6d6f has some mapped public address(es). Please unmap those public address(es) before detaching the gateway.
│       status code: 400, request id: 14bd8f70-258d-4653-bbbf-41791f683495
│ 
│ 
╵
╷
│ Error: deleting EC2 Subnet (subnet-0f176f351fb7eadc5): DependencyViolation: The subnet 'subnet-0f176f351fb7eadc5' has dependencies and cannot be deleted.
│       status code: 400, request id: 35cba0e9-3f33-4f40-979f-100b39e45e1b
│ 
│ 
╵
╷
│ Error: deleting EC2 Subnet (subnet-04c0484d23a97cc9d): DependencyViolation: The subnet 'subnet-04c0484d23a97cc9d' has dependencies and cannot be deleted.
│       status code: 400, request id: 8e8767fb-5263-43fd-a8b8-c6127956bbb6
│ 
│ 
╵
ERRO[1224] Terraform invocation failed in /home/user/expensive.food/aws-base-1/.terragrunt-cache/AxdR91sFvJDz83Xpeya5EMk94PI/guhU0ixwR2xAA1bh1htXoRVtKtI  prefix=[/home/user/expensive.food/aws-base-1] 
ERRO[1224] 1 error occurred:
        * exit status 1

The F5 Distributed Cloud console showed the AWS VPC site created by aws-appstack-site-1. Trying to run terragrunt destroy in aws-appstack-site-1 resulted in no change because it believed everything was destroyed. Manually requesting a destroy and then a delete, removed the AWS and XC artifacts of the AWS VPC Site.

piyerf5 commented 1 year ago

Observed same error on 2nd TGRD of 2/27

aws_subnet.f5-xc-services-internal["az1"]: Still destroying... [id=subnet-0429baeef37161530, 20m0s elapsed] ╷ │ Error: deleting EC2 Internet Gateway (igw-0d6966c2a7b808bb9): error detaching EC2 Internet Gateway (igw-0d6966c2a7b808bb9) from VPC (vpc-04ad3d9289d06b266): DependencyVioltion: Network vpc-04ad3d9289d06b266 has some mapped public address(es). Please unmap those public address(es) before detaching the gateway. │ status code: 400, request id: 60e9fb94-3266-4d8a-bf8c-9b68deaad7fa │ │ ╵ ╷ │ Error: deleting EC2 Subnet (subnet-0429baeef37161530): DependencyViolation: The subnet 'subnet-0429baeef37161530' has dependencies and cannot be deleted. │ status code: 400, request id: c2cf3f79-5ddf-4464-9752-6a02bc7b5d3b │ │ ╵ ╷ │ Error: deleting EC2 Subnet (subnet-0f8af116204ff8e0f): DependencyViolation: The subnet 'subnet-0f8af116204ff8e0f' has dependencies and cannot be deleted. │ status code: 400, request id: 4b282772-6dac-4aa0-b62f-db7403a6d661 │ │ ╵ ╷ │ Error: deleting EC2 Subnet (subnet-0f402de5740fc98db): DependencyViolation: The subnet 'subnet-0f402de5740fc98db' has dependencies and cannot be deleted. │ status code: 400, request id: 59de21fc-b9ff-4483-a71d-510770e207db │ │ ╵ ERRO[2113] Terraform invocation failed in /mnt/c/Users/piyer/Desktop/GitHub Repos/expensive.food/aws-base-1/.terragrunt-cache/bXt4IiyuwMbb5oQKxHx3fcWSp2k/guhU0ixwR2xAA1bh1htxAA1bh1htXoRVtKtI prefix=[/mnt/c/Users/piyer/Desktop/GitHub Repos/expensive.food/aws-base-1] ERRO[2113] Module /mnt/c/Users/piyer/Desktop/GitHub Repos/expensive.food/aws-base-1 has finished with an error: 1 error occurred: