CloudForge
Published 9 min read

How to Reduce AWS NAT Gateway Costs: Find the Traffic, Then Fix the Route

Find which workloads drive NAT gateway data processing charges, then cut them with gateway endpoints, selective interface endpoints, zone-aware routing and less traffic.

CloudForge field noteAWS
AWSFinOpsNetworking

A NAT gateway bill rarely grows because someone added gateways. It grows because more bytes started flowing through gateways that were already there: a new service pulling container images on every deploy, a data job reading from S3 across the gateway, or a logging agent shipping everything to an external endpoint. The fix is almost never "remove the NAT gateway". It is to find which traffic is being processed and give the largest flows a cheaper route.

This guide covers how the charge is built, how to identify the traffic behind it, and the fixes in the order they usually pay back. For the wider account, start with how to reduce AWS costs.

How a NAT gateway is billed

Three meters apply, and they are easy to confuse:

MeterWhat triggers itWhat reduces it
NAT gateway hoursEach hour a gateway is provisioned. A regional NAT gateway is billed for each Availability Zone it is active in.Fewer gateways, or fewer active zones
Data processingEvery gigabyte that passes through the gateway, in either directionRouting traffic around the gateway
Data transferStandard EC2 charges, such as internet egress and traffic that crosses Availability Zones to reach the gatewayZone alignment, less egress

The second meter is the one that surprises teams. It applies to responses as well as requests, so a workload that downloads 1 TB through the gateway pays processing on that 1 TB even though inbound internet transfer itself is free. It also applies to traffic bound for AWS services in the same Region, such as S3, ECR and CloudWatch, unless a VPC endpoint gives that traffic another path.

Rates vary by Region. At the time of writing, US East (N. Virginia) lists $0.045 per gateway hour and $0.045 per gigabyte processed. Always confirm on the Amazon VPC pricing page before estimating savings.

A worked example

The numbers below are a hypothetical scenario to show the arithmetic. They are not a customer result or a forecast.

A VPC runs three zonal NAT gateways and processes 20 TB a month through them. Flow analysis shows the traffic splits as follows: 12 TB to S3, 3 TB of ECR image layer pulls, 2 TB to CloudWatch Logs and 3 TB to the public internet.

ItemBeforeAfterHow
Gateway hours (3 x 730 x $0.045)$98.55$98.55Unchanged
S3 traffic (12,000 GB x $0.045)$540.00$0.00S3 gateway endpoint
ECR layer pulls (3,000 GB x $0.045)$135.00$0.00Layers are served from S3, so the same gateway endpoint carries them
CloudWatch Logs (2,000 GB)$90.00$41.90Interface endpoint: 2,000 GB x $0.01 plus 3 zones x 730 hours x $0.01
Internet traffic (3,000 GB x $0.045)$135.00$135.00Unchanged
Monthly total$998.55$275.45

In this scenario the bill falls by about 72 percent without removing a gateway or changing an application. Internet data transfer out is billed separately and is the same in both columns. Your split will differ, which is why the first step is measurement.

Step 1: Confirm which meter is growing

In Cost Explorer, filter the service to EC2 - Other, group by Usage type, and look for the two NAT usage types: NatGateway-Hours and NatGateway-Bytes. Outside US East (N. Virginia) they carry a Region prefix, for example USW2-NatGateway-Bytes. If the bytes line is most of the cost, continue. If hours dominate, skip to the section on gateway count.

Then find which gateway carries the volume. Each gateway publishes metrics in the AWS/NATGateway CloudWatch namespace. BytesOutToDestination is traffic leaving your VPC through the gateway and BytesInFromDestination is the response traffic coming back.

aws cloudwatch get-metric-statistics \
  --namespace AWS/NATGateway \
  --metric-name BytesOutToDestination \
  --dimensions Name=NatGatewayId,Value=nat-0123456789abcdef0 \
  --start-time 2026-11-01T00:00:00Z \
  --end-time 2026-11-08T00:00:00Z \
  --period 86400 \
  --statistics Sum

Run the same command for BytesInFromDestination. A gateway with heavy inbound volume is usually serving downloads: images, packages, datasets or object reads.

Step 2: Find the sources and destinations

Metrics tell you which gateway. VPC Flow Logs tell you which workloads. Enable flow logs on the VPC or on the gateway's network interface, deliver them to CloudWatch Logs, and query with Logs Insights. The field names below assume the default flow log format.

To find the internal sources sending the most traffic through the gateway, replace 10.0.1.25 with the gateway's private IP address and 10.0. with the first octets of your VPC range:

filter (dstAddr like '10.0.1.25' and srcAddr like '10.0.')
| stats sum(bytes) as bytesTransferred by srcAddr, dstAddr
| sort bytesTransferred desc
| limit 10

To find the external destinations, look at traffic the gateway sends to addresses outside the VPC:

filter (srcAddr like '10.0.1.25' and dstAddr not like '10.0.')
| stats sum(bytes) as bytesTransferred by dstAddr
| sort bytesTransferred desc
| limit 10

Two refinements save time. First, a custom flow log format can include the pkt-dst-aws-service field, which labels traffic bound for services such as S3 or DynamoDB so you do not have to map IP ranges by hand. Second, flow logs themselves cost money to ingest. Capture a representative window, such as a few business days that include a deploy and the nightly batch, then turn the detailed capture off.

Map the top source addresses to workloads using the network interface description, the EKS pod or node, or the ECS task. You should end with a short table: workload, destination, gigabytes per month.

Step 3: Add gateway endpoints for S3 and DynamoDB

Gateway endpoints for S3 and DynamoDB have no hourly charge and no data processing charge. They work by adding a prefix list route to the route tables you choose, so traffic to those services stops using the default route to the NAT gateway.

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
}

Check three things before applying this in production:

  • Bucket policies that use aws:SourceIp. Requests through a gateway endpoint no longer arrive from the NAT gateway's public address. Policies that allow a NAT address will start denying. Use aws:SourceVpce or aws:SourceVpc conditions instead.
  • Cross-Region buckets. A gateway endpoint only serves S3 in the same Region. Reads from a bucket in another Region still go through the NAT gateway, and cross-Region transfer applies as well.
  • Every private route table. An endpoint associated with two of three route tables leaves one zone on the expensive path, and the saving looks smaller than expected.

Because ECR stores image layers in S3, this one endpoint also removes most container image traffic from the gateway.

Step 4: Add interface endpoints only where they pay back

Interface endpoints use AWS PrivateLink. Unlike gateway endpoints, they have an hourly charge for each Availability Zone and a per-gigabyte charge, listed on the PrivateLink pricing page. They are cheaper than NAT processing per gigabyte but they are not free, so each one needs a break-even check.

Using the US East rates above as an example, an endpoint in three zones costs about 3 x 730 x $0.01 = $21.90 a month before any traffic. Each gigabyte moved from the gateway to the endpoint saves about $0.045 minus $0.01, or $0.035. The break-even is roughly 626 GB a month for that service. Below that volume, the endpoint costs more than it saves.

That arithmetic usually justifies endpoints for a small number of services:

  • CloudWatch Logs, when applications log heavily.
  • ECR API and Docker endpoints, when you want image pulls to work without any NAT path. The layer traffic already uses the S3 gateway endpoint.
  • A SaaS observability or data platform that offers its own PrivateLink endpoint service, when agents ship large volumes to it.

It rarely justifies an endpoint for every service an account touches. Low-volume control plane calls to services such as STS or Secrets Manager cost very little through the gateway. Add those endpoints for security or isolation reasons if you need them, not for savings.

Step 5: Fix cross-zone routing and gateway count

Traffic from a subnet in one zone to a NAT gateway in another zone pays cross-zone data transfer in addition to NAT processing. One gateway per zone avoids that charge and removes a single point of failure. For production, that is normally the right design.

For development and test VPCs, the trade is different. Each extra zonal gateway costs about $32.85 a month at the example rate. If cross-zone transfer is billed at $0.01 per gigabyte in each direction, a second gateway only pays for itself above roughly 1.6 TB a month of traffic from that zone. Many non-production VPCs are far below that, so a single gateway is a reasonable saving if the team accepts the availability trade-off.

AWS also offers a regional NAT gateway mode. A regional gateway expands and contracts across zones based on where workloads have network interfaces, and it is billed for each zone it is active in. It does not lower the hourly rate. Its value is operational: one resource and one route target, and no gateway hours in zones that have no workloads. Two limits matter. Expansion into a new zone can take up to 60 minutes, during which traffic is handled from an existing zone, and regional gateways do not support private NAT.

Step 6: Reduce the traffic itself

Routing changes move bytes to a cheaper path. Some bytes should not be moving at all.

  • Container images from public registries. Pulling the same public image on every node launch sends the full image through the gateway each time. An ECR pull-through cache keeps a copy in your Region, where the S3 gateway endpoint serves it.
  • Package installs at build or boot. Bake dependencies into images, or use a private mirror such as CodeArtifact.
  • Telemetry volume. Drop debug logs and high-cardinality metrics at the agent, before they leave the VPC.
  • IPv6 for internet-bound traffic. Dual-stack subnets can send IPv6 traffic through an egress-only internet gateway, which has no hourly or processing charge. This only helps when the destinations support IPv6.

A self-managed NAT instance can also cost less than a managed gateway for small, low-traffic environments. You then own patching, failover and throughput limits. Treat it as an option for development environments, not a default.

What not to do

Do not move workloads into public subnets only to avoid NAT charges. That changes the exposure of the workload and needs a security decision, not a cost decision. Do not delete a gateway because its hourly line looks idle without checking the route tables that reference it. And do not purchase endpoints for every AWS service in one change. Measure, add the two or three that carry volume, then measure again.

Keep it from coming back

  • Create an AWS Cost Anomaly Detection monitor that covers EC2 - Other, so a jump in NAT bytes raises an alert within days and not at invoice time. The anomaly detection playbook covers triage.
  • Add a CloudWatch alarm on BytesOutToDestination and BytesInFromDestination for each production gateway, with a threshold based on a normal week.
  • Put the S3 and DynamoDB gateway endpoints in the VPC module, so every new VPC starts with them.
  • Review the top NAT sources quarterly. New services change the mix.

If NAT is one line in a larger networking bill that nobody has traced, CloudForge's AWS cost optimization work starts with the same measurement steps described here.

Sources

Related expertise

Put this into practice

AWS Well-Architected Review AWS cost optimization Cloud migration consulting
Continue learning
AWS Private Pricing Agreements (EDP): How to Size the Commitment and Negotiate Terms8 min read How to Schedule AWS Non-Production Resources Off-Hours with Native Tools8 min read GCP Network Egress Cost Optimization: Trace the Bill to the Traffic6 min read

Want this applied to your own cloud bill?

CloudForge traces spend to owners, removes waste, plans commitments and sets up the review cadence that keeps savings in place.

See FinOps consulting