[Quick Bites] Gateways

Share
[Quick Bites] Gateways

Internet gateway, NAT gateway and transit gateway: what each one does, plus the Storage Gateway that shares the name.

This is part of my enterprise cloud architecture series.

Gateway is not one thing in AWS. It is a name used for at least four different jobs, and mixing them up is how diagrams end up wrong. Three of them are about network traffic and sit on the diagram. The other one is about storage and usually does not.

Internet Gateway

The internet gateway (IGW) is the door between your VPC and the internet. Without it nothing in the VPC can be reached from the internet and nothing can go out to it. It does not filter anything, that is left to security groups and firewalls. Attaching it is not enough on its own, the subnet routes have to point at it before it does anything.

NAT Gateway

NAT stands for network address translation. The problem is a private subnet: servers there should not be reachable from the internet, but they still need to go out to download updates, call APIs and pull images. The NAT gateway sits in a public subnet and lets them start connections outbound, replies come back, nothing can start a connection inbound. Traffic leaves through the IGW, so NAT does not replace it, it sits in front of it.

Transit Gateway

One VPC is easy. A company has many VPCs, many accounts, and an on-prem network. Connecting each to each one by one turns into a mesh nobody wants to maintain. The transit gateway is the hub, everything connects to it once and it routes between them. This is also where the other gateways get shared. Many companies put one NAT gateway in a central egress VPC and route every VPC to it through the transit gateway, which gives one exit point to watch. The transit gateway charges for data processing, so central egress is not automatically cheaper.

The Storage Gateway

Tape gateway and the NFS gateway are not on the network diagram because they are not network gateways. They are part of AWS Storage Gateway, a service that sits on-prem and connects your existing storage to AWS. The NFS one is the S3 File Gateway, it presents NFS or SMB shares and stores the files as objects in S3. Tape Gateway looks like a tape library to your backup software, but the tapes are in S3 and Glacier. Volume Gateway gives block storage over iSCSI, backed by S3. Same word, different job, so it is worth knowing it exists before someone asks why it is missing.

Why enterprise needs them

In a tutorial there is one VPC and one IGW. In a company there are dozens of VPCs, some with no direct internet access at all, and a data centre that still has to talk to them. The gateways are how that gets controlled instead of every team wiring their own.

The four pillars

PillarIGWNAT GatewayTransit Gateway
SecurityOnly door in and out, filtering is elsewhereOutbound only, no inboundRoute tables decide who talks to who
ReliabilityManaged by AWSLives in one AZ, one per AZ for resilienceSingle hub, a mistake in it hits everything attached
PerformanceNot a bottleneckScales up to a limit per gatewayFine for most, centralising adds a hop
CostNo chargeHourly plus per GB processedPer attachment plus per GB processed

Decision

The decision is central or per VPC. One shared egress and one place to inspect, or a NAT gateway in each VPC and no transit gateway charge on that traffic. Are you okay paying more to have one place to control it.

Gateways are one word on the diagram and four different jobs behind it. That is why they need labels.


Next up: Networking