Skip to content

Instantly share code, notes, and snippets.

@Chaffelson
Chaffelson / rmvpc.py
Created February 21, 2020 09:40 — forked from vernhart/rmvpc.py
Deleting an AWS VPC with python's boto3
#!/usr/bin/env python
"""I was trying to programatically remove a Virtual Private Cloud (VPC) in
AWS and the error message was not helpful:
botocore.exceptions.ClientError: An error occurred (DependencyViolation)
when calling the DeleteVpc operation: The vpc 'vpc-c12029b9' has
dependencies and cannot be deleted.
Searching for a quick solution was not fruitful but I was able to glean some
knowledge from Neil Swinton's gist: