Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix dependency violation errors when deleting EC2 VPC resource types #591

Merged
merged 2 commits into from
Sep 27, 2023

Conversation

james03160927
Copy link
Contributor

@james03160927 james03160927 commented Sep 24, 2023

Description

Fixes #584.
However, some VPC requires to run the cloud-nuke operations twice to delete completely. Some of the errors I couldn't resolve with this change:

  • ERROR Failed to nuke vpc with err: DependencyViolation: Network vpc-00db40ad268a8758a has some mapped public address(es). Please unmap those public address(es) before detaching the gateway.
  • ERROR Failed to nuke vpc with err: DependencyViolation: The subnet 'subnet-0ba8f9c12269ecc6c' has dependencies and cannot be deleted.

The first error goes away when I run it the second time.
The second error seems to be legit error that subnet is being used in other instances. The caller would have to cleanup other resources (dependent) before nuking vpc.

TODOs

Read the Gruntwork contribution guidelines.

  • Update the docs.
  • Run the relevant tests successfully, including pre-commit checks.
  • Ensure any 3rd party code adheres with our license policy or delete this line if its not applicable.
  • Include release notes. If this PR is backward incompatible, include a migration guide.
  • Attention Grunts - if this PR adds support for a new resource, ensure the nuke_sandbox and nuke_phxdevops jobs in .circleci/config.yml have been updated with appropriate exclusions (either directly in the job or via the .circleci/nuke_config.yml file) to prevent nuking IAM roles, groups, resources, etc that are important for the test accounts.

Release Notes (draft)

Added / Removed / Updated [X].

Migration Guide

Copy link
Contributor

@MoonMoon1919 MoonMoon1919 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small nit, otherwise lgtm

Co-authored-by: Max Moon <moon.maxwell@gmail.com>
@james03160927 james03160927 merged commit e92f3eb into master Sep 27, 2023
@james03160927 james03160927 deleted the vpc_dependency_error branch September 27, 2023 00:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DependencyViolation Deleting VPC
2 participants