All articles
DevOps & CloudNovember 30, 2026 6 min read

AWS NAT Gateway Charges Ate 18% of Our Bill: How We Found and Fixed It

A quiet NAT Gateway was quietly draining our AWS budget through S3 and ECR traffic that never needed to leave the VPC. Here's how we traced it and what we changed.

A quarterly cost review turned into a small crisis when we noticed a single line item — EC2-Other — had crept up to roughly 18% of one workload's AWS bill. The culprit wasn't compute. It was a NAT Gateway quietly charging us per gigabyte to move data that, in hindsight, never needed to leave the VPC at all.

This is the walkthrough of how we found it, what the actual traffic looked like, and the handful of changes that brought it back in line. No miracle numbers, no vendor blame — just the boring plumbing most teams ignore until the invoice lands.

Why NAT Gateway bills sneak up on you

AWS NAT Gateway pricing has two components: an hourly charge (around $0.045/hour per gateway in us-east-1, so roughly $32/month just to exist) and a per-GB data processing charge (around $0.045/GB) on top of normal egress. For a multi-AZ setup with three gateways, you're paying ~$100/month before a single byte moves.

The data processing fee is where it gets painful. Every byte that a private-subnet workload sends to anything outside the VPC — including AWS services in the same region — passes through NAT and gets charged. S3, ECR, DynamoDB, Secrets Manager, CloudWatch: all of it, unless you've explicitly set up VPC endpoints.

Most teams know this in the abstract. The problem is that nobody notices until the traffic volume crosses a threshold where the processing fee overtakes the hourly fee, and by then it's been happening for months.

The symptom we actually saw

Our alert wasn't elegant. The monthly cost anomaly detector flagged EC2-Other as up 40% month-over-month in one account. That bucket is a grab bag — it includes NAT data processing, EBS snapshots, inter-AZ traffic, and more — so the first job was figuring out which subcategory was growing.

Cost Explorer with the USAGE_TYPE dimension did the trick. The usage type NatGateway-Bytes was responsible for almost the entire delta. We were processing about 4.2 TB/month through NAT, up from around 2.8 TB the prior month.

Step one: find out what's actually going through NAT

The billing dashboard tells you how much. It doesn't tell you what. For that, you need VPC Flow Logs, and specifically flow logs on the NAT Gateway's ENI or the subnet it lives in.

We already had flow logs going to S3 in a long-standing Athena table. If you don't, enabling them takes about ten minutes but you'll wait a day or two for enough data to analyze meaningfully.

Here's the Athena query that broke open the mystery:

SELECT
  dstaddr,
  SUM(bytes) / 1024 / 1024 / 1024 AS gb_out,
  COUNT(*) AS flow_count
FROM vpc_flow_logs
WHERE year = '2026' AND month = '02'
  AND srcaddr LIKE '10.0.%'
  AND dstaddr NOT LIKE '10.%'
  AND action = 'ACCEPT'
GROUP BY dstaddr
ORDER BY gb_out DESC
LIMIT 50;

The top destinations were a who's-who of AWS service IP ranges. Cross-referencing with the ip-ranges.json AWS publishes, about 71% of our NAT traffic was going to:

  • S3 in the same region (~44%) — image assets and backup uploads from worker nodes
  • ECR (~19%) — container image pulls on every ECS task start
  • CloudWatch Logs and Monitoring (~8%) — log ingestion from the fleet

The remaining 29% was legitimate third-party traffic: webhook deliveries, external APIs, package registries. That portion we couldn't eliminate, only optimize.

Why ECR traffic was so high

ECR deserves its own callout. Our ECS service had aggressive autoscaling and a deploy pipeline that cycled tasks frequently. Each task start pulled the container image fresh from ECR if the cache missed, and with 1.2 GB images and dozens of pulls a day, that adds up fast.

This is one of those cases where a design choice (big images) and an infrastructure choice (no VPC endpoint for ECR) interact to produce an invoice.

Step two: the fixes, in order of ROI

Once we had the breakdown, the fixes were obvious. What mattered was the order.

S3 Gateway Endpoint — free, do it first

S3 and DynamoDB are the only two AWS services with Gateway endpoints, which are free. They attach to your VPC's route tables and route traffic to those services over the AWS backbone without touching NAT.

Here's the Terraform:

resource "aws_vpc_endpoint" "s3" {
  vpc_id            = aws_vpc.main.id
  service_name      = "com.amazonaws.${var.region}.s3"
  vpc_endpoint_type = "Gateway"
  route_table_ids   = aws_route_table.private[*].id
}

Apply this and you immediately stop paying NAT data processing fees for S3 traffic in that region. It took us one PR and a maintenance-window apply. The next day's NAT bytes metric dropped by roughly the 44% we expected.

One caveat: if any of your IAM policies or S3 bucket policies restrict access by source IP, the request now comes from a VPC endpoint, not your NAT's EIP. You may need to update those policies to use aws:SourceVpce instead.

ECR Interface Endpoints — not free, but pays for itself

ECR requires Interface endpoints, which cost about $0.01/hour per endpoint per AZ plus $0.01/GB processed. For our traffic volume, that math still favored the endpoint by a wide margin.

You actually need three endpoints for ECR to work end-to-end:

  • com.amazonaws.<region>.ecr.api
  • com.amazonaws.<region>.ecr.dkr
  • com.amazonaws.<region>.s3 (which we already had as a Gateway endpoint — ECR stores image layers in S3)

If you miss the S3 one, your docker pull will hit the API endpoint but still route layer downloads through NAT. We've seen teams celebrate adding ECR endpoints and then wonder why their bill barely moved.

CloudWatch and Secrets Manager

Similar story. Interface endpoints for logs, monitoring, and secretsmanager eliminated another meaningful chunk. For services where traffic is low, the hourly endpoint cost can exceed what you'd pay through NAT, so do the math per service rather than endpointing everything reflexively.

Container image slimming — the slow fix

In parallel with the endpoint work, we put the container images on a diet. Switching base images and multi-stage builds got one critical service from 1.2 GB to around 340 MB. That reduced the processed bytes through the new ECR endpoint as well, cutting the interface endpoint data charges proportionally.

This is the kind of work that pays off compounding over months. It also made deploys noticeably faster, which was the real selling point when we pitched the time.

What the numbers looked like after

Rough figures from the following month's bill, for the same workload:

  • NAT data processing: down roughly 70%
  • Added interface endpoint cost: about 15% of the savings
  • Net reduction on the account's total bill: around 11%

That 18% line item didn't go to zero — legitimate third-party egress still goes through NAT, and we still pay the hourly charges — but it stopped being the thing we talked about on cost calls.

The audit habit that would have caught it earlier

The lesson isn't "use VPC endpoints." Everyone knows that. The lesson is that nobody was looking until the number got ugly. We now run a quarterly check:

  1. Cost Explorer grouped by USAGE_TYPE, filtered to the last 90 days
  2. Athena query against flow logs for top-10 external destinations by bytes
  3. Cross-reference against AWS IP ranges to catch new services leaking through NAT

It takes about an hour. It's the cheapest hour we spend on cloud cost work.

Where we'd start

If you've never audited NAT traffic, open Cost Explorer, group by usage type, and look at NatGateway-Bytes for the last three months. If it's growing faster than your traffic, enable VPC Flow Logs on the NAT subnet and run the Athena query above. Odds are you'll find S3 or ECR in the top destinations, and odds are the fix is a half-day of Terraform.

The NAT Gateway isn't the villain here. It's doing exactly what it's advertised to do. The failure mode is that its billing is proportional to carelessness, and carelessness compounds quietly until someone notices. If you want help with a cost audit or a broader reliability review, our DevOps and cloud team does this work regularly.

#AWS#Cost Optimization#Networking#DevOps

Want a team like ours?

72Technologies builds production software for the kind of teams who actually read this blog.

Start a project