Topic lessonTopic: VPC: address and connectivity design
NAT gateway architecture and costs: placement, processing and transfer
A NAT gateway translates the source addresses of connections initiated inside a VPC. It can support outbound access from private subnets; it is not an entry point for unsolicited inbound connections. Start with the architecture, then distinguish zonal/regional availability, public/private connectivity and the separate cost drivers.
Explain a suitable NAT type and routing design, then compare AZ-specific hours, bidirectional processing, transfers and public IPv4 costs.
Know subnets, AZs, route tables and internet gateways (IGWs). The main examples use IPv4 egress, with IPv6 distinctions. No fixed monetary rates or live AWS operations are used.
Translation supports an outbound request and its reply
When an application in a private subnet requests an external API, the NAT gateway translates its source IPv4. With public NAT and an IGW in the same VPC, the internet-facing source is the NAT gateway’s associated Elastic IP. Replies are translated back for that connection. External users cannot use that Elastic IP to initiate arbitrary new connections to internal applications.
- Application → Zonal public NATAn appropriate application-subnet route selects NAT; traffic permission remains a separate check.
- Zonal public NAT → Internet gatewayThe translated private IPv4 passes to the IGW, which maps it to the Elastic IP.
- Internet gateway → External APIThe outbound request reaches the destination; its reply is translated back to the initiating resource.
- Application
- Private subnet: route the intended external destinations to NAT.
- Zonal public NAT
- A NAT in a public subnet, with an associated Elastic IP.
- Internet gateway
- The NAT subnet routes to the IGW attached to the same VPC.
- External API
- The intended internet destination.
Two separate choices: connectivity and AZ availability
| Dimension | Choice | Conditions to review |
|---|---|---|
| Connectivity | Public NAT | Can reach the internet with an IGW; Elastic IP use depends on the path |
| Connectivity | Private NAT | For destinations such as connected VPCs or corporate networks; no Elastic IP and no internet access through an IGW |
| Availability mode | Zonal | Located in one AZ; account for paths that depend on that AZ |
| Availability mode | Regional | One NAT ID can serve workloads across AZs; private NAT is not supported |
Regional NAT does not require a public subnet to host the gateway. It is associated with a VPC and has its own route table. Automatic mode expands/contracts with workload presence; manual mode leaves IP and AZ expansion management to you. Do not apply the zonal “place NAT in a public subnet” rule to regional mode.
Zonal placement: shared versus per-AZ gateways
| Placement | Hourly billing units | Routing, failure and transfer considerations |
|---|---|---|
| Share one zonal NAT in AZ-A | One available NAT gateway | AZ-B crosses to A; an outage in A can disrupt B’s outbound path too |
| A zonal NAT in each AZ | Two available NAT gateways | Route each application subnet to same-AZ NAT; hourly units increase |
| Regional NAT configured in two AZs | Hours configured in both AZs | One NAT ID does not mean one AZ-hour; also review paths during expansion |
Choose an option to see the result and explanation.
Separate gateway hours, processed data and other charges
| Component | Quantity to inventory | Common omission |
|---|---|---|
| Gateway hours | Available zonal gateway-hours, or configured regional hours per AZ | Stopping EC2 does not automatically remove NAT billing |
| NAT data processing | Billable GB processed for requests, replies and other traffic | Counting only the outbound file size |
| Data transfer | Applicable AZ, Region and internet paths and directions | Assuming NAT processing includes every transfer charge |
| Public IPv4 and related resources | Addresses used by public NAT and other components | Quoting only the NAT gateway rate |
| Alternative paths | Interface endpoint AZ-hours, processing and other applicable items | Assuming every NAT alternative is free |
NAT cost = sum(billed gateway/AZ hours × matching hourly rate)
+ billed processed GB × applicable processing rate
Related costs = applicable data transfer + public IPv4 + other resources
Compared total = NAT cost + related costsSuppose a synthetic billing plan records 100 GB processed outbound and 40 GB in replies. If both are billable processing quantities, use 140 GB. This is not a measurement and does not equate payload file size with metered usage. Destination and AZ placement can create separate transfer items.
Choose an option to see the result and explanation.
Choose alternatives by destination, not by slogans
For supported same-Region S3 or DynamoDB traffic, a gateway endpoint can provide a path that avoids NAT, without additional gateway-endpoint hourly or processing fees. An interface endpoint uses service-specific network interfaces and brings its own AZ-hour and processing considerations. It does not provide arbitrary access to unrelated external APIs.
An egress-only internet gateway is a different option for outbound-only access to IPv6 internet destinations. NAT64 with DNS64 connects IPv6 workloads to IPv4 destinations and is a separate design. Compare destination address families, DNS, service support, routes and controls before changing approaches.
- Inventory destinations and address families, separating traffic that needs NAT from traffic suitable for endpoints or other paths.
- Record public/private, zonal/regional and automatic/manual choices. Inspect workload/NAT AZs, actual routes and failure scope.
- Estimate AZ-hours, bidirectional processed GB, transfer and public IPv4 for the same period. Record rate Region, unit and check date.
- Before a change, review connection resets, dependencies, migration and recovery. Do not consolidate failure scope solely to reduce hourly units.
- Check dependencies and authority before deleting unused resources. This lesson creates, modifies and deletes nothing.
Check, then explain in your own words
- Explain application-side and NAT-side routes for zonal public NAT.
- Distinguish the number of regional NAT IDs from billed AZ-hours.
- Give three reasons the NAT gateway rate alone is not the total cost.
Check your understanding: Is consolidating NAT into one gateway always the best choice?
No. Compare mode, AZ dependencies, processed data, transfers, destinations and related charges on equal terms.
One ID is not necessarily one billing unit. Zonal consolidation changes cross-AZ traffic and failure scope; regional mode also has per-AZ hours and expansion conditions.
Sources and conditions checked
The official references used in this lesson are collected here with their scope, conditions and corresponding sections. Independent expert review and live AWS comparison have not been performed.
- NAT gatewaysChecked:
Scope and conditionsInitiated outbound connections; public/private NAT connectivity, IPv4 translation and IPv6 DNS64/NAT64 boundaries. Zonal placement is distinguished from regional mode.
Used in this lessonTranslation supports an outbound request and its reply Two separate choices: connectivity and AZ availability Choose alternatives by destination, not by slogans
- NAT gateway basicsChecked:
Scope and conditionsDocumented zonal NAT placement/failure and SG/NACL/NAT64 properties. Single-AZ wording does not override the separate current regional-mode guide.
Used in this lessonTranslation supports an outbound request and its reply Zonal placement: shared versus per-AZ gateways Choose alternatives by destination, not by slogans
- Regional NAT gatewaysChecked:
Scope and conditionsRegional automatic/manual AZ expansion, no hosting subnet, up to 60 minutes for automatic expansion, no private NAT support and connection-reset migration impact.
Used in this lessonTwo separate choices: connectivity and AZ availability Zonal placement: shared versus per-AZ gateways
- Pricing for NAT gatewaysChecked:
Scope and conditionsAvailability hours, processed GB and placement/transfer considerations; no assumed monetary rate.
Used in this lessonSeparate gateway hours, processed data and other charges
Scope and conditionsNAT hours, partial-hour rounding, processing and transfer; regional NAT billed per configured AZ-hour. Related public IPv4 charges remain separate. No fixed monetary quote.
Used in this lessonZonal placement: shared versus per-AZ gateways Separate gateway hours, processed data and other charges
- Gateway endpointsChecked:
Scope and conditionsS3/DynamoDB gateway routes and prefix-list specificity, supported IP/DNS modes and controls; not PrivateLink; no additional gateway endpoint charge.
Used in this lessonChoose alternatives by destination, not by slogans
Scope and conditionsService-supported interface endpoint ENIs, subnet/AZ choice, private DNS prerequisites, SGs and hourly/processing charges.
Used in this lessonSeparate gateway hours, processed data and other charges Choose alternatives by destination, not by slogans
- AWS PrivateLink pricingChecked:
Scope and conditionsInterface endpoint per-AZ hours and processed data, service-specific included pricing and cross-Region transfer considerations; not a claim that all endpoint types share one price.
Used in this lessonSeparate gateway hours, processed data and other charges Choose alternatives by destination, not by slogans
Scope and conditionsIPv6-only outbound initiation with return traffic, distinct from ordinary IGW and IPv4 NAT.
Used in this lessonChoose alternatives by destination, not by slogans