Interview Prep/Networking/VPC & Network Architecture

How do you avoid NAT gateway single points of failure and cross-AZ charges?

IntermediateProductionVPC & Network Architecture
Answer

Deploy one NAT gateway per AZ and give each private subnet's route table a default route to the NAT in its own AZ. A failure of one AZ then affects only that AZ, and traffic does not cross AZ boundaries (cross-AZ data transfer is billed in both directions).

In Terraform, loop over AZs to create aws_nat_gateway and aws_route_table per AZ. For dev environments a single NAT is a fair cost trade.

All Networking questions Roadmap: Networking for DevOps

More on VPC & Network Architecture