gruntwork-io/cloud-nuke

DependencyViolation Deleting VPC

Closed this issue · 2 comments

Quite a lot of errors when deleting VPC resource type. E.g.,

  • DependencyViolation: The vpc 'vpc-0880a5bccc135fa5f' has dependencies and cannot be deleted.
  • status code: 400, request id: d24616cf-fc3e-4ed0-9380-595d88b06338

It seems like there's quite a lot of resources that are dependent or linked to VPC before nuking VPC:

  • Route Tables
  • Subnets
  • Peering Connections
  • VPC Endpoints
  • Network ACLs
  • Security Groups

Note: it seems like phx_devops cloud-nuke operation seems to fail nuking VPC resource types quite a lot as well - https://app.circleci.com/pipelines/github/gruntwork-io/cloud-nuke/12109/workflows/194dd219-8c8a-45b7-981f-17df28488378/jobs/33851.

The order of operation is quite important when deleting EC2 VPC. Need quite a lot of trial & error to figure out the perfect order because there seem to be quite a lot of dependency violation errors.

First operations we can do it nuking DHCP options.