AWS in 1 Min · Episode 40

AWS Internet Gateway explained

The VPC's door to the internet. Watch the one-minute video, then read the details.

David Gomez1:17 video · 3 min read

"Attach an internet gateway and you're online." Not yet. The gateway is only the door. Until there's a route to it and the resource has a public address, nothing gets in or out. It's a common reason a new server in a custom VPC can't be reached.

What an internet gateway is

An internet gateway is the VPC component that allows communication between your VPC and the internet, in both directions: your resources can reach out, and the internet can reach in. It supports IPv4 and IPv6.

You create it, then attach it to a VPC. A VPC can have one internet gateway attached at a time. The default VPC in each Region already comes with one; a VPC you create yourself doesn't.

The three things you need

For a resource to communicate with the internet over IPv4:

  1. An internet gateway is attached to the VPC.
  2. The subnet's route table has a route to the gateway, usually 0.0.0.0/0. That route is what makes it a public subnet.
  3. The resource has a public IPv4 address or an Elastic IP address.

On top of that, its security group and network ACL must allow the traffic. When a server "has internet" but can't be reached, the cause is nearly always one of these four.

It also translates addresses

A resource in your VPC only knows its private IP address. For IPv4, the internet gateway performs one-to-one network address translation: on the way out it swaps the private address for the resource's public address, and on the way in it swaps it back.

This is different from a NAT gateway, which lets many private resources share one public address for outbound connections only. With an internet gateway, each resource needs its own public address, and connections can start from either side. IPv6 addresses are public already, so no translation is needed.

Nothing to manage, almost nothing to pay

AWS describes the internet gateway as horizontally scaled, redundant and highly available. There's no size to choose, nothing to patch and no bandwidth limit to plan around.

There's no charge for the internet gateway itself. You pay the usual data transfer charges for traffic that goes out to the internet, and AWS charges for public IPv4 addresses.

The door opens both ways

Because an internet gateway accepts connections from outside, anything behind it with a public address is reachable by anyone your security groups allow. So:

  • Keep only what must be public in public subnets: typically load balancers.
  • Put servers and databases in private subnets, with no route to the internet gateway.
  • For private resources that need to reach out over IPv4, use a NAT gateway. For IPv6, an egress-only internet gateway allows outbound connections only.

A common mistake is adding the 0.0.0.0/0 route to the VPC's main route table "just to test". Every subnet that uses that table becomes public.

Where AI fits

AI applications make a lot of calls to models, and it's natural to assume they need internet access. For models on AWS, they usually don't.

Amazon Bedrock supports interface VPC endpoints (AWS PrivateLink). AWS documents that with one, you can call Bedrock as if it were inside your VPC, without an internet gateway, NAT device or public IP addresses. Your application servers stay in private subnets and prompts and responses don't cross the public internet.

You still need a way out if your application calls a model provider outside AWS, or downloads packages and model files from the internet. That's a job for a NAT gateway, with outbound-only access.

Quick recap

  • An internet gateway is the VPC's two-way door to the internet. It's managed by AWS and free in itself.
  • Being online also takes a route to the gateway and a public address.
  • AI calls to Bedrock can stay private through VPC endpoints.
AWS in 1 Min #40 · 1:17

Need an AWS expert on your team?

I'm David, an AWS expert and fractional cloud consultant. I work alongside your team to run your cloud and infrastructure: architecture, security, cost and day-to-day operations. You get senior AWS experience when you need it, without the cost of a full-time hire.

  • Architecture reviews and a clear plan for what to fix first
  • Security hardening: IAM, networking, audits
  • Lower AWS bills without slowing your team down
  • Hands-on help with AI workloads on AWS