Created
March 11, 2025 18:41
-
-
Save gsusmonzon/35776decbce7265a0fc8db654f90758e to your computer and use it in GitHub Desktop.
Check if an AWS vpc can be deleted as it is not being used
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aws ec2 describe-instances --filters "Name=vpc-id,Values=<vpc-id>" --region eu-west-3 | |
aws ec2 describe-network-interfaces --filters "Name=vpc-id,Values=<vpc-id>" --region eu-west-3 | |
aws elbv2 describe-load-balancers --query "LoadBalancers[?VpcId=='<vpc-id>']" --region eu-west-3 | |
aws rds describe-db-instances --query "DBInstances[?DBSubnetGroup.VpcId=='<vpc-id>']" --region eu-west-3 | |
aws lambda list-functions --query "Functions[?VpcConfig.VpcId=='<vpc-id>']" --region eu-west-3 | |
aws ec2 describe-vpc-endpoints --filters "Name=vpc-id,Values=<vpc-id>" --region eu-west-3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment