NAT Gateway High Availability
What you'll learn: How to ensure your NAT gateway never becomes a single point of failure by deploying across multiple availability zones.
The Problem with Single NAT Gateways
Remember that a NAT gateway allows instances in private subnets to reach the internet. But what happens if that NAT gateway fails or its availability zone goes down? Your private instances lose internet connectivity entirely. It's like having one exit door in a building—if it's blocked, everyone's trapped.
The Solution: Multi-AZ Deployment
Best practice: Deploy one NAT gateway per availability zone. Each AZ should have:
- Its own NAT gateway
- Its own public subnet (where the NAT gateway lives)
- Route tables configured so private subnets in that AZ use their local NAT gateway
Think of it like having emergency exits on every floor of a building. If one floor's exit fails, the others remain operational.
Why This Matters
Availability zones are physically separate data centers. If AZ-A experiences an outage, your NAT gateway in AZ-B keeps running. Without multi-AZ NAT gateways, an AZ failure takes down internet access for all your private subnets, even those in healthy zones.
The Architecture Pattern
- Private Subnet in AZ-A → routes to → NAT Gateway in AZ-A
- Private Subnet in AZ-B → routes to → NAT Gateway in AZ-B
Each private subnet's route table points to its local NAT gateway, not a shared one.
The Trade-off
Yes, you'll pay for multiple NAT gateways. But this is standard practice for production workloads—redundancy costs money, but downtime costs more.
Key Takeaway: Always deploy one NAT gateway per availability zone to eliminate single points of failure and maintain internet access during AZ outages.