IGW is the door that connects your VPC to the internet. Without it, nothing inside your VPC can talk to the outside world, and no one outside can reach your resources.

EC2 → IGW → Internet
EC2 ← IGW ← Internet

Key Rules

1. One VPC = One IGW

A VPC can only have one IGW attached, and one IGW can only be attached to one VPC.

VPC-A  →  IGW-1   (correct)
VPC-B  →  IGW-2   (correct)

VPC-A  →  IGW-1 + IGW-2   (not allowed)
VPC-A + VPC-B  →  IGW-1   (not allowed)

2. IGW is a Separate Resource

You create the VPC and IGW separately, then attach them together. They are not automatically linked.

3. IGW Alone is Not Enough

After attaching an IGW, you still need to update the Route Table. The IGW is the door, but the Route Table is the sign that tells traffic how to find it.

4. Highly Available

AWS manages IGW automatically. It never goes down and scales with your traffic. You do not need to maintain it.


Complete Setup Steps

To give an EC2 instance internet access, follow these steps in order:

Step 1 - Create IGW Go to VPC console → Internet Gateways → Create

Step 2 - Attach IGW to your VPC Select the IGW → Actions → Attach to VPC

Step 3 - Update Route Table Add a route in the subnet's route table: