Course contentsShow
← Cloud and Infrastructure
Lesson 188 of 2,9894. Cloud Networking BasicsFree lesson

Attaching Internet Gateways to VPCs

Understand how to attach an internet gateway to a VPC and configure route tables for internet connectivity.

Attaching Internet Gateways to VPCs

You'll learn how to connect your VPC to the internet by attaching an internet gateway and updating route tables.

The Missing Link

In the previous lesson, you learned what an internet gateway is—the door between your VPC and the public internet. Now you need to actually install that door and tell traffic how to find it.

Think of it like installing a front door on a house: the door itself (internet gateway) is useless until you (1) physically attach it to the house (VPC), and (2) put up signs inside telling people "exit through the front door for the street."

How Attachment Works

Attaching an internet gateway involves two critical steps:

1. Attach the Gateway to Your VPC

You create an internet gateway resource, then explicitly attach it to exactly one VPC. One internet gateway can only serve one VPC (though a VPC can have only one internet gateway at a time). This is a one-to-one relationship.

2. Update the Route Table

Attachment alone doesn't enable internet access—you must update your route table to direct internet-bound traffic to the gateway. You add a route that says: "For any destination outside our VPC (0.0.0.0/0), send traffic to the internet gateway."

Without this route, your instances don't know the gateway exists. With it, instances in subnets associated with that route table can reach the internet (assuming they also have public IP addresses).

Public Subnet Pattern

A subnet becomes "public" when its route table includes a route to an internet gateway. Private subnets simply omit this route, keeping resources isolated from direct internet access.

Key Takeaway: Attaching an internet gateway requires both connecting it to your VPC and adding a default route (0.0.0.0/0) pointing to it in your route table—only then can resources communicate with the internet.