NAT Gateway
Understand NAT Gateway for private subnet outbound internet access, including cost, AZ placement, routing, and alternatives.
Last reviewed: June 2026
🔍 What Is It?
A NAT Gateway lets resources in private subnets initiate outbound internet connections without allowing unsolicited inbound internet connections.
It is commonly used for package downloads, external APIs, patches, and SaaS integrations from private workloads.
🎯 Why Do We Need It?
Private application servers often need outbound access but should not be directly reachable from the internet.
NAT Gateway supports that pattern by translating private addresses to a public address for outbound traffic.
Common developer mistakes:
- →Choosing defaults without checking security, cost, or failure behavior
- →Treating AWS services as isolated tools instead of part of an architecture
- →Skipping tags, alarms, IAM review, backups, and runbooks until production incidents happen
- →Building manually in the console and then struggling to reproduce environments
🏗️ What Happens in Real Projects?
Application instances in private subnets route 0.0.0.0/0 to a NAT Gateway in the same AZ. The NAT Gateway sits in a public subnet with an Elastic IP.
Enterprises often reduce NAT usage by adding VPC endpoints for AWS services such as S3, ECR, CloudWatch, and Secrets Manager.
⚙️ How It Works
A private subnet route table points internet-bound traffic to a NAT Gateway. The NAT Gateway forwards traffic through the public subnet's internet gateway and tracks connection state for return traffic.
NAT Gateway is AZ-scoped, so resilient designs place one NAT Gateway per AZ and route private subnets to the local NAT.
💻 Example
NAT route design — Private subnet outbound routing with AZ alignment.
🤔 Common Confusions
❓ Does NAT Gateway allow inbound internet traffic?
No. It supports outbound connections initiated by private resources.
❓ Is NAT Gateway free?
No. It has hourly and data processing charges, so architecture should watch usage.
❓ Do I need NAT to reach S3?
Not necessarily. You can use an S3 VPC endpoint to avoid routing S3 traffic through NAT.
🚨 Common Production Issues
**Single NAT Gateway** creates AZ dependency or outage impact.
**Unexpected NAT cost** from high-volume AWS service or data transfer traffic.
**Wrong route table** leaves private instances without outbound access.
**Using NAT for everything** ignores cheaper and more private VPC endpoint options.
✅ Best Practices
Use one NAT Gateway per AZ for critical multi-AZ workloads
Route private subnets to the NAT Gateway in the same AZ
Use VPC endpoints for common AWS service traffic
Monitor NAT bytes, errors, and cost
Avoid placing application servers in public subnets just for outbound access
Document which workloads require internet egress
🏛️ Architect's Note
NAT Gateway is convenient, reliable, and easy to forget on the bill. Good architects design egress intentionally: what needs internet, what can use private endpoints, and what should be blocked entirely.
💬 Frequently Asked Questions
🎯 Key Takeaways
🔗 Related Topics
🎯 Practice this topic in interviews
↗ Where this topic fits
AWS Technology Guide
Return to the AWS learning hub.
Backend Engineer Career Path
A structured journey through Core Java, Spring Boot, production backend engineering, and interview preparation.
Python Developer Career Path
A practical route through Python fundamentals, automation, backend basics, testing, projects, interview preparation, and career growth.
Sources
Sources / References
Use these AWS references to verify the concept in official docs and continue into the most relevant SplashRide pages.
Official documentation
Related SplashRide pages
SplashRide AWS learning path
Browse the full AWS topic collection and learning order on SplashRide.
AWS Interview Prep
Practice AWS interview questions and scenario-based answers.
Backend Engineer Career Path
A structured journey through Core Java, Spring Boot, production backend engineering, and interview preparation.
Python Developer Career Path
A practical route through Python fundamentals, automation, backend basics, testing, projects, interview preparation, and career growth.
VPC
Understand Amazon VPC as the private network boundary for subnets, routing, security groups, NAT, load balancers, and workload isolation.
Route Tables
Learn AWS route tables for deciding where subnet traffic goes, including internet gateways, NAT gateways, VPC endpoints, and peering.