Skip to main content
NAT Gateway Costs: The Silent Line Item and How to Cut It

NAT Gateway Costs: The Silent Line Item and How to Cut It

KU
· Founder & Chief Editor
• 8 min read•Updated •30 views

NAT Gateway bills $0.045 for every GB it processes, including traffic to S3 and ECR that never needed to leave the VPC. Here's how to find it and cut it.

Key takeaways

  • AWS NAT Gateway charges about $0.045 per hour plus $0.045 per GB processed, and the per-GB fee is usually the big number.
  • Add free S3 and DynamoDB gateway endpoints first, then interface endpoints for busy services like ECR, and keep traffic in its own Availability Zone.

To cut NAT Gateway costs, stop sending AWS-bound traffic through it. Add the free S3 and DynamoDB gateway endpoints to every VPC, add interface endpoints for high-volume services like ECR, and route each subnet to a NAT in its own AZ. The $0.045 per GB processing fee, not the hourly charge, is what makes the bill large.

Verified against

NAT Gateway (zonal and regional availability modes), VPC gateway and interface endpoints, against the AWS VPC pricing page, the AWS PrivateLink pricing page, the Amazon VPC User Guide and the Amazon ECR VPC endpoint docs. Checked October 2026.

The pattern is common. A line called "EC2 Other" on the AWS bill creeps up, nobody can say what it is, and it turns out to be a NAT Gateway processing tens of terabytes a month. Most of that traffic is services pulling objects from S3 and images from ECR, both of which live inside AWS. You are paying a per-gigabyte processing fee to route AWS traffic to AWS.

Why the bill hides

NAT Gateway has two charges that stack. The pricing page examples (US East, as of October 2026) show $0.045 per hour per gateway, about $33 a month, which nobody notices. Then there's data processing at $0.045 per GB, and that one scales with traffic: 30 TB a month is roughly $1,380 in processing alone, before any internet egress. It's easy to miss because most cost reports file it under "EC2 Other", not under anything labeled "NAT." You have to go looking.

The first move is to confirm the volume with flow logs. Enable them on the NAT Gateway's ENI and query in Athena:

SQL
-- athena: top destinations through the NAT ENI
SELECT pkt_dstaddr,
       SUM(bytes) / 1073741824.0 AS gib
FROM vpc_flow_logs
WHERE interface_id = 'eni-0a1b2c3d4e5f'
  AND start >= 1719792000
GROUP BY pkt_dstaddr
ORDER BY gib DESC
LIMIT 20;

If the top destinations resolve to S3 and ECR address ranges, that's the tell. You're paying data processing for nothing, because those services can be reached over VPC endpoints that skip NAT entirely.

Gateway endpoints for S3 and DynamoDB are free

This is the highest-return change and it costs nothing. The VPC User Guide says it plainly: "There is no additional charge for using gateway endpoints." They exist only for S3 and DynamoDB. You associate route tables and your S3 traffic stops touching the NAT Gateway.

vpc-endpoints.tf
resource "aws_vpc_endpoint" "s3" {
  vpc_id            = aws_vpc.main.id
  service_name      = "com.amazonaws.us-east-1.s3"
  vpc_endpoint_type = "Gateway"
  route_table_ids   = [aws_route_table.private_a.id,
                       aws_route_table.private_b.id]
}

AWS adds a prefix-list route to each associated table, and longest-prefix match sends S3 traffic for that Region to the endpoint instead of the NAT. Two caveats: S3 buckets in a different Region still go through NAT, because prefix lists are per Region, and the ECR docs warn that existing S3 connections can be briefly interrupted when you add the endpoint. Do it in a quiet window. If S3 is a big line on your bill for other reasons too, S3 cost traps covers the storage and request side.

Interface endpoints for everything else, with a catch

ECR, Secrets Manager, STS, CloudWatch Logs, and most other services use interface endpoints (PrivateLink). Those cost money: $0.01 per hour for each endpoint ENI, one per AZ, plus $0.01 per GB for the first petabyte processed in a Region (PrivateLink pricing, as of October 2026). That per-GB rate is well under NAT's $0.045, so the math flips fast when volume is high.

For ECR you need three endpoints working together, and people miss this: ecr.api, ecr.dkr, and the S3 gateway endpoint, because ECR stores image layers in S3. The ECR docs require the S3 gateway endpoint for private pulls. Set up only the first two and the layer downloads still hit NAT.

vpc-endpoints.tf
resource "aws_vpc_endpoint" "ecr_dkr" {
  vpc_id              = aws_vpc.main.id
  service_name        = "com.amazonaws.us-east-1.ecr.dkr"
  vpc_endpoint_type   = "Interface"
  subnet_ids          = aws_subnet.private[*].id
  private_dns_enabled = true
  security_group_ids  = [aws_security_group.endpoints.id]
}

The endpoint security group must allow inbound 443 from the private subnets, and ecr.dkr needs private DNS enabled, or the Docker client keeps resolving the public endpoint.

Run the numbers before you add every endpoint. One ENI at $0.01 an hour is about $7.30 a month. Moving a GB from NAT to the endpoint saves $0.035, so each AZ the endpoint lives in breaks even at roughly 210 GB a month. A three-AZ endpoint needs around 630 GB a month to pay for itself. A service pushing 2 GB a month through NAT is cheaper left alone.

The cross-AZ trap

The other quiet cost is placement. A zonal NAT Gateway lives in one AZ. If it sits in us-east-1a and an instance in us-east-1b uses it, you pay NAT processing plus standard inter-AZ data transfer on every byte that crosses zones. On chatty workloads that adds up fast. The classic fix is one NAT Gateway per AZ, with each private subnet routed to the gateway in its own zone. You pay more in hourly fees (three gateways instead of one), but you stop paying cross-AZ transfer, and on any real volume that wins.

AWS now offers a second option: a regional NAT gateway. It expands across AZs automatically based on where your ENIs are, keeps zonal affinity, needs no public subnet, and is billed per AZ it runs in ($0.045 per hour per AZ in the pricing page example). It doesn't support private NAT, and the docs say expansion into a new AZ can take up to 60 minutes, during which traffic is processed cross-zone.

Terminal
aws ec2 create-nat-gateway --vpc-id vpc-12345678 --availability-mode regional
aws ec2 describe-nat-gateways --nat-gateway-ids nat-12345678

Converting from zonal to regional resets existing connections, so schedule it. If the VPC layout itself is fuzzy, AWS VPC explained covers subnets, route tables and gateways from the ground up.

What's left after the fixes

Once S3 and ECR traffic moves to endpoints and placement is per AZ, what remains on the NAT is genuine outbound internet: third-party APIs, package registries, webhook deliveries. That's the traffic NAT is for, and it's not worth fighting. If you want to cut that too, the levers are different: caching package mirrors inside the VPC, or proxying registries through a pull-through cache.

To see what your own gateways cost and how much S3 and DynamoDB endpoints would save, run your numbers through the NAT gateway cost calculator.

Questions people ask

Why is my NAT Gateway so expensive?

Usually the data processing charge, not the hourly one. NAT Gateway bills $0.045 per GB processed on top of $0.045 per hour (AWS pricing examples, October 2026), and every byte to S3, ECR or other AWS APIs from a private subnet counts. Pull VPC flow logs for the NAT ENI, group by destination, and you'll typically find AWS service ranges at the top.

Do VPC gateway endpoints cost anything?

No. The Amazon VPC User Guide states there is no additional charge for gateway endpoints, which exist only for S3 and DynamoDB. Interface endpoints are different: they cost $0.01 per hour per ENI per AZ plus $0.01 per GB for the first petabyte, so they pay off only above a few hundred GB a month.

Does an S3 gateway endpoint help with ECR pulls?

Yes, and it's required for fully private pulls. ECR stores image layers in S3, so a pull fetches the manifest from ECR and the layers from S3. The ECR docs say you need the ecr.api and ecr.dkr interface endpoints plus the S3 gateway endpoint. Without the gateway endpoint, layer downloads still go through NAT.

The call we'd make

Add the S3 and DynamoDB gateway endpoints today, in every VPC, no analysis needed: they're free and they only help. Then pull flow logs, find your top NAT destinations, and add interface endpoints for any AWS service pushing more than a few hundred GB a month per AZ. Keep traffic in its own AZ, with per-AZ NAT Gateways or a regional NAT gateway. The caveat: endpoints you add "just in case" cost $7 a month per AZ each, and dozens of them quietly become their own line item. The traffic left over is the traffic you're supposed to be paying for.

Sources

Explore topics:AWSCloud
React
Share this post
Cite this article
Plain text

Kiril Urbonas (2026). NAT Gateway Costs: The Silent Line Item and How to Cut It. DevOpsNess. Updated 2026-10-31. https://www.devopsness.com/blog/nat-gateway-costs-cutting-the-silent-line-item

Markdown

[NAT Gateway Costs: The Silent Line Item and How to Cut It](https://www.devopsness.com/blog/nat-gateway-costs-cutting-the-silent-line-item) (Kiril Urbonas, DevOpsNess, updated 2026-10-31)

KU

Kiril Urbonas

Founder & Chief Editor

605 articles
View all articles by Kiril Urbonas

You might have missed

Evergreen posts worth revisiting.