1Custom vs Main Tables
Never use the main route table for public subnets. Keep the main table completely private and explicitely associate custom tables to public subnets. This acts as a fail-safe so any newly created subnet that defaults to the main table remains isolated from the internet.
2Step-by-Step Breakdown
The IGW. An IGW is a highly available VPC component that enables communication with the internet.
Attaching IGW. An IGW must be explicitly attached to your custom VPC.
Main Route Table. Every VPC comes with a main route table containing a 'local' route by default.
Custom Route Tables. Always create custom route tables for public and private subnets instead of modifying the main route table.
Knowledge Check. What route must be added to a route table to make its associated subnets public?
- →10.0.0.0/16 -> IGW
- →0.0.0.0/0 -> IGW
Adding the Default Route. Add the 0.0.0.0/0 route pointing to the IGW.
Subnet Association. A route table must be explicitly associated with a subnet to govern its traffic.
Route Evaluation. The most specific route (longest prefix match) is always evaluated first. Local routes take precedence over 0.0.0.0/0.
Security Groups vs Route Tables. Route tables determine WHERE traffic goes. Security Groups determine IF traffic is allowed.
Summary. IGWs and custom route tables form the backbone of your public subnet architecture.
