Why your NAT gateway bill is so high, and how to cut it
By the Outseen team ·
NAT gateways are one of the most common surprises on an AWS bill. They charge for every hour they exist and for every gigabyte that goes through them. That includes traffic to S3, ECR and DynamoDB in the same region, which most teams assume is free.
This guide explains how NAT gateways are billed, then finds the cause in four steps: confirm it in Cost Explorer, find the gateway, find the instances, and fix it. Most of the commands only read. The fixes change routing, so try them outside production first.
How NAT gateways are billed
In us-east-1, a standard NAT gateway costs:
| Charge | Price | What it means |
|---|---|---|
| Each hour a NAT gateway exists | $0.045 | $32.85 per gateway (730 hours), with no traffic at all |
| Each GB it processes | $0.045 | In both directions, whatever the source or destination, including AWS services like S3 |
| Its public IPv4 address (public gateways only) | $0.005 an hour | $3.65 per address, like any public IPv4 address; private NAT gateways have none |
| Data transfer | Usual rates | Internet egress, and cross-AZ traffic between an instance and a NAT gateway in another AZ, are billed on top |
Two things make this add up. First, the usual high-availability setup puts one NAT gateway in each Availability Zone, so three AZs cost $98.55 a month before any traffic. A regional NAT gateway is billed the same way: for each AZ it's configured in. Second, the per-GB charge applies to traffic that never leaves AWS. If private instances pull 2,000 GB a month of container images and S3 objects through the gateway, that's $90 a month in processing alone, and most of it can go through a free endpoint instead.
Prices differ by region. Check the Amazon VPC pricing page for yours.
1. Confirm it in Cost Explorer
NAT gateways don't appear under VPC. They're part of EC2-Other:
- Open Cost Explorer and set Service to EC2-Other.
- Set Group by to Usage type.
- Look for usage types ending in NatGateway-Hours (the hourly charge) and NatGateway-Bytes (the processing charge). They start with a region code, such as USE2- for Ohio.
- Cross-AZ traffic shows up in the same view as DataTransfer-Regional-Bytes.
The split tells you where to look. If NatGateway-Hours is most of the cost, you have more gateways than you need (step 2). If NatGateway-Bytes is most of it, something is sending a lot of traffic through them (step 3).
2. Find the gateways, and the idle ones
List every NAT gateway in a region:
aws ec2 describe-nat-gateways --region us-east-1 \ --filter Name=state,Values=available \ --query 'NatGateways[].[NatGatewayId,VpcId,SubnetId,CreateTime]' \ --output table
Then see how much each one sends, per day, for the last 30 days. Change the dates and the gateway ID:
aws cloudwatch get-metric-statistics --region us-east-1 \ --namespace AWS/NATGateway \ --metric-name BytesOutToDestination \ --dimensions Name=NatGatewayId,Value=nat-0123456789abcdef0 \ --start-time 2026-10-18T00:00:00Z --end-time 2026-11-17T00:00:00Z \ --period 86400 --statistics Sum \ --query 'sort_by(Datapoints,&Timestamp)[].[Timestamp,Sum]' \ --output text
BytesOutToDestination is traffic going out from your instances. BytesOutToSource is traffic coming back to them, such as downloads. Together they give a rough idea of what you're billed for processing. A gateway where both stay near zero for weeks, in a test or old environment, is costing $32.85 a month for nothing. Check nothing depends on it, then delete it.
Regional NAT gateways also need the AvailabilityZone dimension in this command.
3. Find which instances send the traffic
CloudWatch metrics show the total, not who's behind it. For that, turn on VPC Flow Logs for the NAT gateway's network interface: in the VPC console, open the NAT gateway, follow its network interface, and create a flow log on the Flow logs tab, sending to CloudWatch Logs. Flow logs cost money to ingest and store, so collect a day or two and then delete the flow log.
Then run these queries in CloudWatch Logs Insights. Replace 10.0.1.25 with the gateway's private IP and 10.0. with the start of your VPC's CIDR range.
The instances sending the most through the gateway
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
The outside addresses sending the most back (downloads)
filter (dstAddr like '10.0.1.25' and srcAddr not like '10.0.') | stats sum(bytes) as bytesTransferred by srcAddr, dstAddr | sort bytesTransferred desc | limit 10
If the top addresses in the second query belong to S3, your instances are reaching S3 through the NAT gateway. Container image pulls from ECR show up here too, because ECR stores image layers in S3. To check an address, list S3's ranges in your region:
curl -s https://ip-ranges.amazonaws.com/ip-ranges.json \ | jq -r '.prefixes[] | select(.service=="S3" and .region=="us-east-1") | .ip_prefix'
4. Fix it
Route S3 and DynamoDB through gateway endpoints (free)
Gateway endpoints for S3 and DynamoDB have no hourly charge and no processing charge. Once a private subnet's route table is associated with one, traffic to that service in the same region goes through the endpoint instead of the NAT gateway. Pass the route tables of your private subnets:
aws ec2 create-vpc-endpoint --region us-east-1 \ --vpc-id vpc-0123456789abcdef0 \ --service-name com.amazonaws.us-east-1.s3 \ --route-table-ids rtb-0123456789abcdef0 rtb-0fedcba9876543210
- Use com.amazonaws.<region>.dynamodb as the service name for DynamoDB.
- Only same-region traffic uses the endpoint. Requests to a bucket in another region still go through the NAT gateway.
- Existing connections to S3 can drop briefly when the route is added, so pick a quiet moment.
- If you have bucket policies that only allow your NAT gateway's public IP, update them: traffic through the endpoint doesn't come from that IP.
For many teams, this one change removes most of NatGateway-Bytes, including the bulk of ECR image pulls.
Use interface endpoints only where the volume pays for them
Other services, including the ECR API, use interface endpoints. They aren't free: in AWS's us-east-1 pricing example, each one costs $0.01 per hour in each AZ, plus $0.01 per GB. That saves $0.035 per GB against the NAT gateway. Across three AZs, one interface endpoint costs about $21.90 a month, so it pays off at roughly 630 GB a month of traffic to that service. Image layers already go through the S3 gateway endpoint, so the ECR API endpoints rarely carry that much.
Keep traffic in its own Availability Zone
If a private subnet in one AZ routes to a NAT gateway in another, you pay cross-AZ data transfer on top of processing. Give each AZ its own gateway and point each private subnet's route table at the gateway in the same AZ.
Share one gateway in development
For dev and test VPCs, one NAT gateway instead of one per AZ saves $32.85 a month for each gateway you remove. The trade-off: if that AZ has an outage, the whole environment loses outbound internet access. Environments that sit idle can have their NAT gateway deleted and recreated when needed.
5. Hear about new NAT gateways when they're created
The hourly charge starts the moment a gateway is created, often by a Terraform module nobody re-read. CloudTrail records every CreateNatGateway call, and EventBridge can match it. This pattern only matches calls that succeeded:
{
"source": ["aws.ec2"],
"detail-type": ["AWS API Call via CloudTrail"],
"detail": {
"eventSource": ["ec2.amazonaws.com"],
"eventName": ["CreateNatGateway"],
"errorCode": [{ "exists": false }]
}
}We tested it with aws events test-event-pattern:
| Event | Result | Why |
|---|---|---|
| CreateNatGateway | true | a new gateway |
| CreateNatGateway, call failed | false | errorCode is set, so nothing was created |
| DeleteNatGateway | false | a different event |
| RunInstances | false | a different event |
To send it to email, set up the SNS topic, topic policy and rule exactly as in our EC2 launch alert guide, with this pattern instead. Like that rule, it only sees its own region. It also only tells you a gateway exists: the traffic, which is usually the bigger cost, shows up later in the metrics from step 2.
Where Outseen fits
Outseen watches the same CreateNatGateway events. When one arrives, it prices the new gateway at the live list prices for its region: the hourly charge, its public IPv4 address if it has one, plus an assumed 100 GB a month of processing. It says what that leaves out (more traffic than that, and data transfer out). If the estimate is over your policy's threshold, it goes to the approver the policy names, who can Approve, Reject or Request Downsize. Outseen does the same for EC2, EBS, RDS, Aurora, S3, load balancers, ElastiCache, Redshift, EKS and SageMaker.
It doesn't watch traffic on gateways you already have. For that, use the Cost Explorer view and metrics above, or AWS Cost Anomaly Detection. See what Outseen does and doesn't cover compared with AWS Budgets and Cost Anomaly Detection, and the exact IAM permissions it asks for. Running MySQL 8.0 or PostgreSQL 13 on RDS? See what RDS Extended Support costs.