AWS Certified Solutions Architect – Associate
NAT gateway costs, gateway endpoints and data transfer charges
A NAT gateway charges per hour and per GB it processes. When private instances send heavy traffic to Amazon S3 or DynamoDB in the same Region, a gateway endpoint takes that traffic off the NAT gateway at no extra charge. Keep chatty resources in the same Availability Zone as their NAT gateway, because traffic between zones is billed too.
What a NAT gateway costs
You pay for each hour a NAT gateway is available and for each GB it processes. AWS suggests two ways to cut the processing charge. Keep resources that send a lot of traffic in the same Availability Zone as the NAT gateway, or create a NAT gateway in each zone that has resources. And send traffic for AWS services through gateway or interface endpoints instead of the NAT gateway.
A NAT gateway in each Availability Zone also means one zone's failure does not cut off the others. It adds hourly charges and removes cross-zone traffic.
Gateway endpoints vs interface endpoints
Gateway endpoints exist only for Amazon S3 and DynamoDB, and there is no additional charge for them. You associate the endpoint with subnet route tables, and AWS adds a route whose destination is the service's prefix list. Only subnets whose route table is associated use it.
A gateway endpoint can't be used from on-premises networks, from another Region, or through a transit gateway. Interface endpoints use private IP addresses in your subnets, can be reached over Direct Connect, VPN, VPC peering or a transit gateway, and are billed.
You can run both in one VPC for S3. In-VPC traffic uses the free gateway endpoint and on-premises traffic uses the interface endpoint.
How data transfer is billed
Data coming into AWS from the internet is free. Data going out to the internet is charged.
Data moving between Availability Zones in the same Region is charged in both directions for each metered resource. Some services do not charge for in-Region traffic, so check the service's pricing page.
Between Regions, the charge is on the data leaving the source Region. Data arriving in the destination Region has no charge.
Where the exam catches people
- Believing an S3 interface endpoint is the cheapest fix for NAT charges: for in-VPC traffic in the same Region, the gateway endpoint does it with no additional charge.
- Believing a gateway endpoint serves on-premises or transit gateway traffic: it only serves subnets in its own VPC whose route tables are associated with it.
- Believing one central NAT gateway is the cheapest design: traffic from other zones adds inter-AZ charges on top of NAT processing.
- Believing a gateway endpoint covers S3 in other Regions: prefix lists are per Region, so traffic to another Region's S3 still uses the default route.