AWS NAT Gateway data processing cost: find it in EC2-Other and cut it with VPC endpoints
AWS NAT Gateway charges a per-GB data processing fee on every gigabyte that flows through it, whether the destination is the internet or an AWS service in the same Region, per the Amazon VPC pricing page (checked November 2026). The charge appears in Cost Explorer under EC2-Other as the NatGateway-Bytes usage type, not under VPC. Gateway VPC endpoints for S3 and DynamoDB remove that fee for S3 and DynamoDB traffic by routing it around the NAT gateway.
Why is my NAT gateway bill so high?
NAT Gateway bills two line items: NatGateway-Hours for each hour the gateway runs, and NatGateway-Bytes for every GB it processes in either direction. Both appear under EC2-Other in Cost Explorer, often buried alongside EBS volumes and inter-AZ data transfer.
The per-GB rate is published on the Amazon VPC pricing page (checked November 2026). You pay the NatGateway-Bytes fee even when the traffic goes to S3, DynamoDB or other AWS services in the same Region. If your EC2-Other costs are rising and you can’t explain why, start by isolating NatGateway-Bytes.
How do I find NAT gateway charges in Cost Explorer?
In the AWS Billing and Cost Management console, open Cost Explorer, set the date range to the last 90 days, filter Service to EC2-Other, and group by Usage type. Look for entries like USE2-NatGateway-Bytes or USW2-NatGateway-Bytes; in us-east-1 the usage type has no Region prefix and appears as plain NatGateway-Bytes. To see which specific NAT gateway is responsible, query your Cost and Usage Report in Athena:
SELECT
line_item_resource_id,
line_item_usage_type,
ROUND(SUM(line_item_usage_amount), 1) AS usage_amount,
ROUND(SUM(line_item_unblended_cost), 2) AS cost_usd
FROM cur_db.cur_table
WHERE line_item_product_code = 'AmazonEC2'
AND line_item_usage_type LIKE '%NatGateway%'
AND line_item_usage_start_date >= current_timestamp - INTERVAL '30' DAY
GROUP BY line_item_resource_id, line_item_usage_type
ORDER BY cost_usd DESC;
To measure traffic volume, use CloudWatch metrics in the AWS/NATGateway namespace, filtered by NatGatewayId. Processed bytes are BytesInFromSource (traffic leaving your VPC) plus BytesInFromDestination (responses coming back). Run the command below, rerun it with --metric-name BytesInFromDestination, and add the two sums:
aws cloudwatch get-metric-statistics \
--namespace AWS/NATGateway \
--metric-name BytesInFromSource \
--dimensions Name=NatGatewayId,Value=nat-0123456789abcdef0 \
--start-time "$(date -u -d '30 days ago' +%Y-%m-%dT%H:%M:%SZ)" \
--end-time "$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
--period 86400 --statistics Sum
To identify where the traffic is going, enable VPC Flow Logs on the NAT gateway’s network interface (found under VPC > NAT gateways), deliver logs to S3, and query in Athena. Replace '10.%' with your VPC CIDR:
SELECT
CASE WHEN srcaddr LIKE '10.%' THEN dstaddr ELSE srcaddr END AS remote_ip,
ROUND(SUM(bytes) / 1e9, 1) AS gb
FROM vpc_flow_logs
WHERE interface_id = 'eni-0123456789abcdef0'
GROUP BY 1
ORDER BY gb DESC
LIMIT 25;
Match the top IPs against the S3 and DynamoDB managed prefix lists:
aws ec2 describe-managed-prefix-lists \
--filters Name=prefix-list-name,Values=com.amazonaws.us-east-1.s3,com.amazonaws.us-east-1.dynamodb
aws ec2 get-managed-prefix-list-entries --prefix-list-id pl-0123456789abcdef0
Flow Logs carry a per-GB log delivery charge plus S3 storage, so turn them off after one week. Then list the route tables that send traffic to each NAT gateway. These are the route tables you will associate with the endpoints:
aws ec2 describe-route-tables \
--filters Name=route.nat-gateway-id,Values=nat-0123456789abcdef0 \
--query 'RouteTables[].RouteTableId' --output text
Check your own bill in 2 minutes: https://revelations.consulting/checker?utm_source=blog&utm_medium=organic&utm_content=blog-aws-nat-gateway-data-processing-cost
How do I cut NAT gateway costs without breaking anything?
Move S3 and DynamoDB traffic to gateway VPC endpoints. They have no hourly or data processing charge. A gateway endpoint adds a route to the VPC’s route tables for the AWS-managed prefix list (pl-...) with the endpoint (vpce-...) as the target. Traffic matching that prefix list leaves the VPC directly, bypassing the NAT.
Create the endpoints without route tables first. That gives you the vpce-... IDs for the policy check below without changing any routing. AWS adds the prefix-list route itself when you associate a route table later, so do not add it by hand:
aws ec2 create-vpc-endpoint \
--vpc-id vpc-0123456789abcdef0 \
--vpc-endpoint-type Gateway \
--service-name com.amazonaws.us-east-1.s3
Repeat for DynamoDB:
aws ec2 create-vpc-endpoint \
--vpc-id vpc-0123456789abcdef0 \
--vpc-endpoint-type Gateway \
--service-name com.amazonaws.us-east-1.dynamodb
Before associating any route table, update bucket and IAM policies that allow access by aws:SourceIp. Requests through a gateway endpoint no longer come from the NAT’s public IP, and aws:SourceIp does not match them. A policy that allows only the NAT’s IP will start denying S3 calls the moment the route goes live. Add the new endpoint ID as a second allowed path, as in this safe pattern, which denies a request only when it comes from neither the NAT IP nor the endpoint:
{
"Sid": "DenyUnlessFromNatOrEndpoint",
"Effect": "Deny",
"Principal": "*",
"Action": "s3:*",
"Resource": [
"arn:aws:s3:::my-bucket",
"arn:aws:s3:::my-bucket/*"
],
"Condition": {
"NotIpAddress": { "aws:SourceIp": "203.0.113.10/32" },
"StringNotEquals": { "aws:SourceVpce": "vpce-0123456789abcdef0" }
}
}
Test on a non-production route table first. Associating a route table changes routing for every subnet that uses it, and existing connections from those subnets to S3 or DynamoDB can drop when the route is added or removed. Do it in a quiet window and make sure your clients retry. Associate one route table:
aws ec2 modify-vpc-endpoint --vpc-endpoint-id vpce-0123456789abcdef0 \
--add-route-table-ids rtb-0123456789abcdef0
Confirm the route table now has a prefix-list route that targets the endpoint:
aws ec2 describe-route-tables --route-table-ids rtb-0123456789abcdef0 \
--query 'RouteTables[].Routes[?GatewayId==`vpce-0123456789abcdef0`]'
Then make a signed head-bucket call from an instance in that subnet to a bucket in the same Region:
aws s3api head-bucket --bucket my-bucket --region us-east-1
Give it 24 hours, then confirm the drop in Cost Explorer (NatGateway-Bytes, daily granularity) and in the NAT gateway’s BytesInFromSource metric in CloudWatch. To roll back, remove the route table from the endpoint:
aws ec2 modify-vpc-endpoint --vpc-endpoint-id vpce-0123456789abcdef0 \
--remove-route-table-ids rtb-0123456789abcdef0
Associate one route table at a time, starting with dev or non-critical workloads. Leave 0.0.0.0/0 to the NAT gateway in place, it still handles non-AWS traffic.
What it usually looks like
When NatGateway-Bytes is a large share of EC2-Other, check whether the top destinations in your flow logs fall inside the S3 or DynamoDB prefix lists. If they do, look at these sources first: container image pulls from ECR (which stores layers in S3), log shippers, backup jobs, and data pipelines.
The second common pattern is a VPC with a NAT gateway and no gateway endpoints at all. Run aws ec2 describe-vpc-endpoints --filters Name=vpc-endpoint-type,Values=Gateway to confirm both S3 and DynamoDB endpoints exist in every VPC with a NAT gateway.
For NatGateway-Hours, one NAT per Availability Zone is standard for production. Consolidating to one NAT forces cross-AZ traffic, which adds data transfer charges.
I cut a ~$1M/yr cloud bill by 26% at a former employer. Checks like these are where that kind of work starts.
This week, pull NatGateway-Bytes from Cost Explorer and match your top flow-log destinations against the S3 and DynamoDB prefix lists. Then add gateway endpoints to one non-production route table and watch the bytes drop. If you want a senior engineer to check the numbers with you, book a free 30-minute consult: https://revelations.consulting/?utm_source=blog&utm_medium=organic&utm_content=blog-aws-nat-gateway-data-processing-cost#contact
Run your own numbers: NAT Gateway vs. VPC Endpoint Calculator.
Frequently asked questions
Why is NAT Gateway cost under EC2-Other and not VPC?
AWS bills NAT Gateway under the Amazon EC2 product code (AmazonEC2), so both NatGateway-Hours and NatGateway-Bytes appear in Cost Explorer under EC2-Other, not VPC. This grouping also includes EBS volumes and inter-AZ data transfer.
How do I find the exact cost of NAT Gateway data processing in my account?
Look for NatGateway-Bytes in Cost Explorer with Service set to EC2-Other and Group by set to Usage type. In the Cost and Usage Report, filter line_item_usage_type for NatGateway-Bytes. The per-GB rate is published on the Amazon VPC pricing page (checked November 2026).
Can I use a VPC endpoint for all outbound internet traffic?
No. Gateway VPC endpoints cover only S3 and DynamoDB, and interface endpoints cover other AWS services such as Secrets Manager and ECR at an hourly plus per-GB charge. Traffic to third-party APIs and other internet destinations still needs the NAT gateway.
What’s the difference between gateway and interface VPC endpoints?
Gateway endpoints are route table entries for S3 and DynamoDB with no hourly or data processing charge. Interface endpoints are private network interfaces in your subnets, billed per hour per AZ plus per GB processed. Use gateway endpoints for S3 and DynamoDB; use interface endpoints for other services that require private access.
Do I need to change my application code to use VPC endpoints?
No. Gateway VPC endpoints work through route-table prefix lists, not DNS, so applications that call S3 or DynamoDB in the same Region as the VPC need no code changes; requests to other Regions, including the global S3 endpoint from outside us-east-1, still go through the NAT gateway. You do need to update bucket or IAM policies that allow access by aws:SourceIp, because requests through a gateway endpoint no longer come from the NAT gateway’s public IP.
Run the numbers on your own bill: What are your NAT gateways costing you, and what would VPC endpoints save?. Free, in your browser.
Want this kind of thing weekly? Get Cloud Bill Weekly. Want us to find it in your bill? We're taking three founding clients for a free Cost Assessment.