Cut NAT gateway costs: VPC endpoints first, NAT last
In many AWS environments most NAT traffic goes to AWS itself: ECR images, S3 objects, logs. Here is how to build egress with free gateway endpoints, interface endpoints above break-even and a regional NAT gateway for the rest.
Contents
Key takeaways
- A NAT gateway in Frankfurt charges 0.052 USD per GB, including traffic to S3, ECR and CloudWatch in the same Region.
- Gateway endpoints for S3 and DynamoDB are free and also take ECR image layers off the NAT, because ECR stores them in S3.
- An interface endpoint across three AZs only saves money above roughly 630 GB a month per service. Below that it is a security decision.
- Measure first with VPC Flow Logs and the pkt-dst-aws-service field to see how much NAT traffic goes to AWS itself.
- The regional NAT gateway makes operations simpler but does not lower the cost per AZ or per GB.
When I go through the AWS bill with a new client, the NAT gateway almost always sits higher up than anyone expected. Nobody planned it as a cost item. It came with the VPC module from the Terraform Registry or with the console wizard, one per Availability Zone, and from then on every byte leaving a private subnet takes this one path. Including the bytes that never wanted to reach the internet.
That is what this article is about. In most environments I see, the bulk of NAT traffic is internal AWS traffic: container images from ECR, objects from S3, logs sent to CloudWatch. In Frankfurt you pay 0.052 USD per GB processed for that traffic, even though a good part of it has a free path. So my recommendation is to build egress from the inside out. Free gateway endpoints first, interface endpoints only where the math works, and the NAT gateway only for traffic that actually has to reach the internet.
What a NAT gateway costs in Frankfurt
Prices from the AWS Price List API for eu-central-1, as of November 2026: a NAT gateway costs 0.052 USD per hour plus 0.052 USD for every GB it processes. The public IPv4 address adds 0.005 USD per hour. A single gateway therefore costs about 42 USD a month before a single byte has moved. The usual setup with three gateways for three AZs comes to about 125 USD in fixed charges.
The real lever is traffic, though. At 6 TB a month you pay 312 USD for processing alone. And that fee applies no matter where the traffic goes. A docker pull from ECR in the same Region costs exactly as much per GB through the NAT gateway as a call to an external API.
You can see the split in AWS Cost Explorer within minutes. Group by usage type and filter on EUC1-NatGateway-Hours and EUC1-NatGateway-Bytes. If bytes clearly outweigh hours, the rest of this article is worth your time.
Measure first: where your NAT traffic goes
Before you change anything, you need the answer to one question: how much of your NAT traffic goes to AWS services, and how much goes to the internet? VPC Flow Logs on the NAT gateway network interfaces give you that answer, with a custom log format. The field pkt-dst-aws-service maps the destination IP to an AWS service when it falls inside that service's published IP ranges.
aws ec2 create-flow-logs \
--resource-type NetworkInterface \
--resource-ids eni-0abc123def4567890 \
--traffic-type ALL \
--log-destination-type s3 \
--log-destination arn:aws:s3:::example-flowlogs \
--log-format '${pkt-srcaddr} ${pkt-dstaddr} ${bytes} ${flow-direction} ${pkt-dst-aws-service}'
After a few days, query the logs with Athena. The filter on the source address makes sure you only count traffic from your own VPC, here with the example CIDR 10.0.0.0/16:
SELECT pkt_dst_aws_service, round(sum(bytes) / 1e9, 1) AS gb
FROM nat_flow_logs
WHERE pkt_srcaddr LIKE '10.0.%'
GROUP BY pkt_dst_aws_service
ORDER BY gb DESC
Values such as S3 or DYNAMODB are unambiguous. Many other AWS services show up as AMAZON because their IP ranges overlap. For ECR, CloudWatch Logs and STS, also look at the top destination IPs and match them against ip-ranges.json. An empty field usually means real internet traffic.
The target architecture: endpoints first, NAT last
This is the setup I build for SaaS and e-commerce environments without their own cloud team. Traffic leaves the private subnet on one of three paths, and only the bottom one pays NAT fees.
Gateway endpoints for S3 and DynamoDB
A gateway endpoint is nothing more than an entry in your route tables: the service prefix list points to the endpoint instead of the NAT gateway. AWS charges nothing for it, neither per hour nor per GB. In Terraform it takes seven lines:
resource "aws_vpc_endpoint" "s3" {
vpc_id = aws_vpc.main.id
service_name = "com.amazonaws.eu-central-1.s3"
vpc_endpoint_type = "Gateway"
route_table_ids = aws_route_table.private[*].id
}
The effect is often larger than people expect, because ECR stores image layers in S3. When an ECS task or an EKS node pulls an image, the heavy data comes from S3 and not from the ECR API endpoint. With the S3 gateway endpoint those layers bypass the NAT for free. For teams that deploy several times a day and run autoscaling, that adds up to several TB a month quickly.
Two limits are worth knowing. Gateway endpoints only cover buckets in the same Region, so a bucket in eu-west-1 still goes through the NAT gateway. And existing S3 connections can drop briefly when you add the endpoint, because the route changes. Put it in a maintenance window or accept a few retries on purpose.
Interface endpoints only above break-even
ECR API calls, CloudWatch Logs, STS, Secrets Manager and most other services are reachable through interface endpoints on AWS PrivateLink. Those are not free. In Frankfurt they cost 0.012 USD per hour per AZ plus 0.01 USD per GB. One endpoint across three AZs costs about 26 USD a month before any traffic.
Per GB you save 0.042 USD compared to the NAT gateway. The math is simple: 26.28 USD divided by 0.042 USD gives about 630 GB. An interface endpoint in three AZs only saves money above roughly 630 GB a month for that service. With two AZs the threshold drops to about 420 GB.
This leads to advice that contradicts a lot of blog posts: do not create interface endpoints for everything. Four endpoints for ecr.api, ecr.dkr, logs and sts across three AZs cost a bit over 105 USD a month. Because the layers go through S3 anyway, ecr.dkr and ecr.api usually carry little traffic, and STS calls are tiny. CloudWatch Logs is a different story. A chatty service passes 1 TB a month easily, and there the endpoint pays for itself.
resource "aws_vpc_endpoint" "logs" {
vpc_id = aws_vpc.main.id
service_name = "com.amazonaws.eu-central-1.logs"
vpc_endpoint_type = "Interface"
subnet_ids = aws_subnet.private[*].id
security_group_ids = [aws_security_group.endpoints.id]
private_dns_enabled = true
}
There is one good reason to ignore the threshold: security. If your workloads should have no internet access at all, for example under NIS2 or audit requirements, you need the endpoints regardless of volume. In that case you are making a security decision with a price tag attached. Write it down that way in your architecture docs so nobody removes it as waste a year from now.
A regional NAT gateway for the rest
What remains is real internet traffic: payment providers, Git hosting, external SaaS APIs, OS updates. That is what the NAT gateway is for. AWS added the regional NAT gateway in November 2025, and for new VPCs it is the only kind I use. It attaches to the VPC instead of a subnet, needs no public subnet in every AZ and expands on its own into the AZs where your workloads run. You maintain one route table entry with one NAT ID instead of three.
Do not expect it to save money, though. The hourly fee applies per active AZ and the per-GB price is the same. The gain is operational: fewer subnets, fewer routes, and no forgotten gateway when someone adds a fourth AZ. Check first whether you need private NAT, for example for overlapping networks to a data center, because only zonal mode supports it.
A worked example
Take a typical environment with three zonal NAT gateways and 6 TB of NAT traffic a month. The measurement shows 3.5 TB going to S3, most of it ECR layers, 1.2 TB to CloudWatch Logs, 0.3 TB to other AWS APIs and 1 TB to the internet.
Before the change you pay about 114 USD in hourly fees, 11 USD for the three IPv4 addresses and 312 USD for processing, so roughly 437 USD a month. After adding the S3 gateway endpoint and one interface endpoint for logs, 1.3 TB stays on the NAT gateway, which is about 68 USD in processing. The logs endpoint costs 26 USD plus 12 USD for 1.2 TB. The total comes to about 231 USD, close to 47 percent less. The biggest single saving is the free S3 endpoint at 182 USD.
For development and staging I go one step further and run a single NAT gateway in one AZ. That saves about 83 USD a month per environment. The price is losing internet access if that one AZ has trouble, plus 0.01 USD per GB for traffic crossing AZs. In production I do not take that risk.
The order I work in
In week one I turn on flow logs on the NAT interfaces and add the gateway endpoints for S3 and DynamoDB at the same time, because they cost nothing and carry no risk for the application. After a week of data I decide per service, using the 630 GB threshold, whether an interface endpoint is worth adding. Only then, at the next planned VPC change, do I switch to the regional NAT gateway and remove the public subnets nobody needs anymore.
For a manageable environment this takes one to two days, and the savings show up on the next monthly bill. If you want to know how much of your NAT traffic goes to AWS itself, the Athena query above is the fastest way to a number. Once people have seen that number, they usually create the S3 gateway endpoint the same afternoon.
Frequently asked questions
Why is my AWS NAT gateway so expensive?
On top of the hourly fee AWS charges for every GB processed, 0.052 USD in Frankfurt. That fee also applies to traffic to AWS services such as S3, ECR or CloudWatch Logs. In many environments this internal traffic is the largest part of the NAT bill.
Does an S3 gateway endpoint cost anything?
No. Gateway endpoints for S3 and DynamoDB have no hourly or per-GB charge. They only cover resources in the same Region, though, and not traffic from on-premises networks or through a transit gateway.
When is an interface endpoint cheaper than a NAT gateway?
In Frankfurt an interface endpoint costs 0.012 USD per hour per AZ plus 0.01 USD per GB. Across three AZs that is about 26 USD a month, and you save 0.042 USD per GB compared to NAT. Above roughly 630 GB a month per service the endpoint saves money.
Does a regional NAT gateway reduce costs?
Hardly. The hourly fee applies per active AZ and the per-GB price is the same. The benefit is operational: no public subnet per AZ, one route with one NAT ID and automatic expansion into new AZs.
Sources
- AWS Price List API: Amazon EC2 offer file eu-central-1 (NAT gateway prices)
- AWS Price List API: Amazon VPC offer file eu-central-1 (VPC endpoint and public IPv4 prices)
- Amazon VPC pricing
- AWS PrivateLink pricing
- Gateway endpoints (Amazon VPC documentation)
- Amazon ECR interface VPC endpoints (AWS PrivateLink)
- Flow log records (Amazon VPC documentation)
- AWS NAT Gateway now supports regional availability (What's New, November 2025)
- Regional NAT gateways for automatic multi-AZ expansion (Amazon VPC documentation)
- Introducing Amazon VPC Regional NAT Gateway (AWS Networking and Content Delivery Blog)
Related articles
- AWS backups that survive a stolen admin loginMost AWS backups live in the same account as production and can be deleted with the same admin role. Here is how a backup account, Vault Lock and restore tests give you an architecture that survives ransomware.
- Migrating MySQL to Aurora: why I took AWS DMS back outI planned a MySQL to Aurora migration around AWS DMS and removed it after the first rehearsal. What went wrong, how XtraBackup, an S3 restore and binlog replication saved the cutover and when DMS is still the right call.
- GitOps with ArgoCD and Helm: Auditable Releases for Regulated IndustriesGitOps with ArgoCD and Helm makes every release auditable: who approved what and when is in the commit. Rollback through Git, security scans in the CI pipeline.