Quizzes · Networking · Level 0
NAT gateway
Lets things in private subnets reach out to the internet, while nothing can reach in.
Think of it as: A one-way turnstile at the gate. Staff can go out, strangers can't walk in.
What to know for Level 0
- A NAT gateway sits in a public subnet, and the private subnets' route tables send
0.0.0.0/0 to it. Things in private subnets can then call out, while nothing can call in. - A VPC-attached Lambda function, or a Fargate task or EC2 instance in a private subnet, needs a NAT gateway (or a VPC endpoint) to reach the internet or public AWS services like SQS. Without one, calls time out.
What to know for Level 1
- A NAT gateway lives in one AZ. With one NAT gateway, private subnets in other AZs lose their way out if that AZ fails, and pay for cross-AZ traffic. For resilience, put one NAT gateway in each AZ, used by that AZ's private subnets.
- A NAT gateway has an Elastic IP: everything from the private subnets that goes through it reaches the internet from that one address, which a partner can allow-list.
More detail
A NAT gateway sits in a public subnet. Private subnets send their internet-bound traffic to it, and it forwards that traffic out through the internet gateway. Lambda functions attached to a VPC need one (or VPC endpoints) to call AWS services like SQS. It’s charged per hour and per GB, which is why VPC endpoints are often the cheaper, more private choice.
Quiz yourself on NAT gateway →Study flash cards
← All quizzes