We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Internet Gateways (IGW)

The eagle-eyed among you may have noticed that there is currently no difference between our "public" and "private" subnets.

Anything we put in either type of subnet cannot access the internet, and nothing on the internet can access it. Our environment looks like this:

There is a gap between our network and the internet. Usually when folks refer to a subnet as public, they mean the servers inside can access the internet (egress), and with limitations, the internet can access them (ingress).

Our PatientPing public subnets need:

  • An Internet Gateway (IGW) that can connect them to the internet
  • A route that tells servers in these subnets to use that IGW

The route tells outgoing traffic, "Hey, this gateway exists; if you're trying to reach a server that's not in our network, look here."

Assignment

PatientPing servers need access to the internet. Start by attaching an IGW to our VPC.

Cost check: Internet gateways are free. You only pay for data transfer.

We don't have a route yet (we'll take care of that next), but we're one step closer.

Run and submit the CLI tests.

Tip

If you want to use the CLI instead, here's the command structure:

# Create an internet gateway
aws ec2 create-internet-gateway --tag-specifications 'ResourceType=internet-gateway,Tags=[{Key=Name,Value=<name>}]'
# Attach the IGW to a VPC
aws ec2 attach-internet-gateway --internet-gateway-id <igw-id> --vpc-id <vpc-id>