SAA-C03 ยท Network security in the VPC
Private egress with NAT
Letting private subnets reach the internet with a NAT gateway (placement, Elastic IP, per-AZ design) versus a NAT instance, and the egress-only internet gateway for IPv6.
Key points
- Public NAT gateway: outbound IPv4 for private subnets; no inbound connections.
- Zonal: in a public subnet, Elastic IP at creation, private routes send 0.0.0.0/0 to it.
- Redundant only in its AZ: build one per AZ; a regional NAT gateway spreads across AZs by itself.
- Managed, 5 to 100 Gbps, no security group.
- NAT instance: EC2 you patch and size yourself.
- IPv6 outbound-only: egress-only internet gateway.
Source: https://docs.aws.amazon.com/vpc/latest/userguide/nat-gateway-basics.html
Practice questions
Where do you create a public zonal NAT gateway that gives private subnets internet access?
- In one of the private subnets it serves
- In a public subnet with a route to the internet gateway
- Directly attached to the VPC, like an internet gateway
- In any subnet, as long as it has a security group
Show answer
Answer: B. In a public subnet with a route to the internet gateway
A public zonal NAT gateway goes in a public subnet, because its own outbound traffic must reach the internet gateway. The private subnets only point their default route at it. It is not attached to the VPC like an internet gateway.
Which statements about NAT gateways are correct?
- You cannot associate a security group with it
- It starts at 5 Gbps and scales automatically up to 100 Gbps
- A public one needs an Elastic IP address at creation
- It accepts inbound connections started from the internet
- You must patch its operating system during maintenance windows
Show answer
Answer: A. You cannot associate a security group with it, B. It starts at 5 Gbps and scales automatically up to 100 Gbps, C. A public one needs an Elastic IP address at creation
You cannot attach a security group to a NAT gateway, it scales automatically from 5 Gbps up to 100 Gbps, and a public NAT gateway needs an Elastic IP when it is created. It never accepts unsolicited inbound connections, and as a managed service there is no operating system for you to patch; that burden belongs to a NAT instance.
Once private subnets route through a NAT gateway, servers on the internet can open connections to instances in those subnets.
Show answer
Answer: False
False. Connections through a NAT gateway must always be started from inside the VPC; the NAT gateway translates the replies back, but it does not accept unsolicited inbound connections. Inbound access needs a public subnet or a load balancer.
Practice 8 questions on this topic in Bitzu
Short lessons, instant explanations and spaced review of what you get wrong. Free on iOS and Android.
