EC2 No Internet Access in a Custom VPC: Attaching an IGW and Fixing Route Tables
TL;DR Launching an EC2 instance in a custom VPC public subnet without internet access almost always comes down to three missing pieces. Fix all three and traffic flows. Missing Component Symptom Fix Internet Gateway (IGW) No outbound route exists Create & attach IGW to VPC Route Table Entry 0.0.0.0/0 has no target Add route: 0.0.0.0/0 → IGW Public IP / Elastic IP Instance has no routable address Enable auto-assign public IP or attach EIP Why This Happens: The Architecture Logic AWS does not wire internet connectivity automatically when you create a custom VPC. The default VPC comes pre-configured with an IGW and a default route, which is why beginners never hit this wall there. The moment you create a custom VPC, you own the entire network stack. Think of it like a new office building. The building (VPC) has rooms (subnets) and internal hallways (local routes). But until the city connects a road to the building's front door (IGW) a...