Cannot delete a VPC: `The vpc has dependencies and cannot be deleted`.
BeginnerTroubleshootingVPC and Connectivity
Answer
Likely causes → ENIs, endpoints, NAT or gateways still exist.
Diagnose →
aws ec2 describe-network-interfaces --filters Name=vpc-id,Values=vpc-0abc
aws ec2 describe-vpc-endpoints --filters Name=vpc-id,Values=vpc-0abc
aws ec2 describe-nat-gateways --filter Name=vpc-id,Values=vpc-0abc
Fix →
- Delete dependencies in order: instances, endpoints, NAT, IGW, subnets, SGs, route tables, VPC
Prevent → Manage VPCs with IaC for clean teardown.
More on VPC and Connectivity
`ssh: connect to host 3.250.1.1 port 22: Connection timed out`. Walk the checks.Beginner`ssh: connect to host ... port 22: Connection refused`. How is it different from a timeout?Beginner`Permission denied (publickey)` on a new EC2 instance.IntermediatePrivate instances cannot reach the internet; `curl: (28) Connection timed out after 10000 milliseconds`.IntermediateNAT gateway shows `ErrorPortAllocation` in CloudWatch and connections drop.IntermediateVPC peering is `active` but ping fails.Intermediate