Course contentsShow
← Security
Lesson 1831 of 3,05237. Cloud Security - Network ArchitectureFree lesson

NAT Gateway Architecture

Deploying NAT gateways to enable outbound internet access for resources in private subnets.

What You'll Learn

You'll learn how to use NAT gateways to allow resources in private subnets to initiate outbound connections to the internet—while keeping them protected from inbound traffic.

The Problem NAT Gateways Solve

Remember private subnets from earlier lessons? They don't have direct routes to an Internet Gateway, which keeps your backend servers safe from direct internet exposure. But what if those servers need to download patches, call external APIs, or access SaaS services?

That's where a NAT Gateway comes in—it acts as an intermediary that translates private IP addresses to a public IP for outbound connections only.

How NAT Gateway Architecture Works

Think of a NAT gateway like a secure mail room in an office building. Employees (private subnet resources) can send packages out to the world through the mail room, which uses the building's public address. But random people outside can't walk through the mail room to reach employees inside.

Deployment Pattern

  1. Deploy in a public subnet – The NAT gateway itself needs a route to the Internet Gateway
  2. Assign an Elastic IP – This becomes the public-facing address for all outbound traffic
  3. Update private subnet route tables – Add a route sending 0.0.0.0/0 (all internet-bound traffic) to the NAT gateway
  4. Availability zone placement – Deploy one NAT gateway per AZ for high availability

Traffic Flow

  • Outbound: Private instance → NAT gateway → Internet Gateway → Internet
  • Inbound: Blocked (NAT is one-way only; no unsolicited inbound connections allowed)

This asymmetric design is the security sweet spot: your databases can fetch updates, but attackers can't probe them directly.

Key Takeaway: NAT gateways enable secure outbound internet access for private subnet resources by performing address translation in a public subnet, while maintaining complete protection against unsolicited inbound connections.