There is a line on a lot of AWS bills that nobody meant to buy: NAT gateway data processing, charged for every gigabyte that leaves a private subnet, and a surprising share of those gigabytes are going to Amazon S3 in the same region. Backups, log shipping, model weights, container layers, data-lake reads, the nightly export: all of it hops through the NAT gateway and pays the toll, even though S3 is sitting right there inside AWS.
A gateway endpoint for S3 fixes that with one route. It costs nothing, takes about five minutes, and it also removes a hop from every request. This article explains what the endpoint actually does, why it saves money and latency, and walks through an example with the arithmetic shown. Prices are us-east-1 list prices at the time of writing.
What a NAT gateway charges for
A NAT gateway has two charges: an hourly fee for the gateway itself ($0.045 per hour, about $32.85 a month), and a data processing fee of $0.045 for every gigabyte that passes through it, in either direction. The hourly fee is fixed. The data processing fee scales with traffic, and it does not care where the traffic is going.
That last part is what catches people. The NAT gateway’s job is to let instances in private subnets reach the internet. But by default, “the internet” includes the public endpoints of AWS services, and S3’s endpoints are public. So a private-subnet instance uploading a 50 GB backup to a bucket in the same region sends 50 GB through the NAT gateway and pays $2.25 in processing for it. Download it again and that is another $2.25. Do that every night, across a fleet, and the NAT line quietly becomes one of the bigger items in a small account’s bill.
The data transfer itself, meanwhile, is free: traffic between EC2 and S3 in the same region is not charged. The NAT gateway is the only thing billing you, and it is billing you for a hop you do not need.
What a gateway endpoint does
A gateway endpoint is a route, not a device. When you create one for S3, AWS gives you a prefix list (pl-…) that holds S3’s IP ranges for the region, and adds a route for that prefix list to the route tables you choose, pointing at the endpoint. From then on, any packet from those subnets addressed to S3 matches the more specific prefix-list route before it matches 0.0.0.0/0, and goes straight to S3 over the AWS network instead of to the NAT gateway.
Nothing changes in your applications. The S3 hostnames resolve to the same addresses as before; the difference is which route the packets take. There is no elastic network interface, no security group, nothing to size and nothing to scale.
And it is free. Gateway endpoints for S3 and DynamoDB have no hourly charge and no per-gigabyte charge. The same traffic that cost $0.045 a gigabyte through the NAT gateway costs $0 through the endpoint. Interface endpoints, which use PrivateLink, are different: they are billed per hour per Availability Zone and per gigabyte, and we cover when they are worth it in the NAT gateway and data transfer guide. For S3 in the same region, the gateway endpoint is almost always the right answer.
Why it is faster, not only cheaper
A NAT gateway is a network address translation device. Every S3 connection from a private instance is rewritten to the gateway’s public address on the way out and back on the way in, and the traffic leaves the VPC through the internet gateway to reach S3’s public endpoint. Three things follow from that.
First, the path is longer. Instance to NAT gateway to internet gateway to S3, and the same in reverse. With a gateway endpoint it is instance to S3 over the AWS backbone. The extra hop is small in milliseconds, but it is paid on every request, and S3 workloads are often thousands of small requests rather than a few large ones. Listing a prefix with 100,000 objects, reading Parquet footers, pulling container layers: per-request overhead adds up.
Second, you stop sharing the NAT gateway’s throughput. A NAT gateway supports 5 Gbps of bandwidth and scales up to 100 Gbps, and it also has a limit of 55,000 simultaneous connections to each unique destination. A large S3 copy job on a busy fleet competes with everything else leaving the VPC through that gateway, and a burst of parallel S3 requests can hit the per-destination connection limit, which shows up as ErrorPortAllocation in the NAT gateway’s CloudWatch metrics and as timeouts in your application. Traffic through the gateway endpoint is not subject to either.
Third, the traffic never leaves the AWS network. For a security review that matters more than the latency: the bucket policy can require that requests arrive through your endpoint (aws:SourceVpce), which is a stronger statement than “requests come from our NAT gateway’s public IP.”
A worked example
Take a modest setup: an EKS cluster and a few EC2 instances in private subnets in one region, behind one NAT gateway. Over a month they do roughly this with S3 in the same region:
| Traffic | Per month | Through the NAT gateway |
|---|---|---|
| Nightly database and volume backups to S3 | 900 GB | $40.50 |
| Application and access logs shipped to S3 | 300 GB | $13.50 |
| Container images and model files pulled from S3 | 400 GB | $18.00 |
| Analytics jobs reading a data lake in S3 | 600 GB | $27.00 |
| S3 traffic through NAT | 2,200 GB | $99.00 |
Plus the gateway’s hourly fee of $32.85 and whatever genuine internet traffic the fleet has, say 200 GB of package downloads and third-party API calls, another $9.00.
The NAT gateway line reads about $141 a month, and $99 of it is S3.
Add a gateway endpoint to the private subnets’ route tables and the S3 rows go to $0. The hourly fee stays, because the instances still need the NAT gateway for the 200 GB that really is internet traffic. The bill becomes $32.85 plus $9.00, about $42, a saving of $99 a month or about $1,190 a year, for a route table change.
Scale the numbers to your own account: the saving is simply your S3 gigabytes through NAT multiplied by $0.045. The section below shows how to find that number.
Find out how much of your NAT traffic is S3
You cannot see the destination of NAT traffic on the bill; the bill only shows the total gigabytes processed. Two read-only checks get you the answer.
First, how big is the NAT line at all? Cost Explorer can filter to the usage type:
aws ce get-cost-and-usage \
--time-period Start=2026-10-01,End=2026-11-01 \
--granularity MONTHLY \
--metrics UsageQuantity UnblendedCost \
--filter '{"Dimensions":{"Key":"USAGE_TYPE","Values":["NatGateway-Bytes"]}}'
Second, which destinations make up those bytes? VPC Flow Logs on the NAT gateway’s network interface, queried in CloudWatch Logs Insights or Athena, show the top destination addresses. Anything in S3’s address ranges for your region is traffic a gateway endpoint would take over. The ranges are published:
curl -s https://ip-ranges.amazonaws.com/ip-ranges.json \
| jq -r '.prefixes[] | select(.service=="S3" and .region=="us-east-1") | .ip_prefix'
If you do not have flow logs, there is a cheaper proxy: the S3 request metrics and the BytesDownloaded and BytesUploaded metrics on your busiest buckets, compared with the NAT gateway’s BytesOutToDestination. When the two move together day by day, the NAT traffic is the S3 traffic.
Check what you already have
Many accounts have a gateway endpoint in one VPC and not in the others, or have one that is only attached to the public subnets’ route table, where it does nothing useful. List them:
aws ec2 describe-vpc-endpoints \
--filters Name=vpc-endpoint-type,Values=Gateway \
--query 'VpcEndpoints[].[VpcEndpointId,VpcId,ServiceName,State,RouteTableIds]' \
--output table
Then check that the private subnets’ route tables are in that list, and that each of them carries the prefix-list route:
aws ec2 describe-route-tables \
--query 'RouteTables[].[RouteTableId,Associations[].SubnetId,Routes[?DestinationPrefixListId!=null].[DestinationPrefixListId,GatewayId]]' \
--output json
A private subnet whose route table has 0.0.0.0/0 to a nat-… and no pl-… route to a vpce-… is sending its S3 traffic through the NAT gateway.
Create the endpoint
Creating it is a change, so this is the one step we describe rather than run. In the VPC console choose Endpoints, Create endpoint, service com.amazonaws.<region>.s3 of type Gateway, pick the VPC, and tick the route tables of the private subnets. With the CLI it is one command: aws ec2 create-vpc-endpoint --vpc-id … --service-name com.amazonaws.us-east-1.s3 --vpc-endpoint-type Gateway --route-table-ids rtb-… rtb-….
Two details are worth getting right on the first try. Attach it to every route table a private subnet uses, including the ones Auto Scaling groups and EKS node groups create in other Availability Zones; a subnet you miss keeps paying. And leave the endpoint policy at full access unless you have a reason to restrict it. A tight policy here is a common way to break a workload the next day, because the policy applies to every bucket, including the AWS-owned ones that package repositories and ECR layers live in.
The change takes effect as soon as the route is in place. Existing connections finish on their old path; new ones take the endpoint. Nothing restarts.
What it does not cover
Gateway endpoints have a short list of limits that are worth knowing before you count the saving.
The endpoint serves S3 in the same region as the VPC. A bucket in another region is still reached through the NAT gateway, and cross-region traffic carries its own data transfer charge on top. If that is a large share of your S3 traffic, replicate the data or move the workload; the endpoint will not help.
It only applies to traffic from inside the VPC. Requests from on-premises networks over Direct Connect or a VPN, and from peered VPCs, do not use the gateway endpoint; they need an interface endpoint, which has its own hourly and per-gigabyte prices.
It does not cover S3 Transfer Acceleration endpoints or FIPS endpoints; traffic to those keeps its original path.
And it does nothing for DynamoDB. DynamoDB has its own gateway endpoint, just as free, and worth creating in the same five minutes if your private subnets talk to it.
Related things to look at
Once the S3 traffic is off the NAT gateway, look at what is left going through it. ECR, CloudWatch Logs, Secrets Manager, SSM and STS all have interface endpoints, and for a fleet that talks to them constantly the per-hour price of an interface endpoint can be lower than the NAT processing it replaces; the arithmetic for that is in the NAT gateway guide. If the NAT gateway ends up carrying very little, one per Availability Zone may be more than you need.
On the S3 side, the gigabytes you were paying to move are also gigabytes you are paying to store. Lifecycle rules and the right storage class for data nobody reads are in S3 storage classes and lifecycle rules, and backups older than their retention are covered in the EBS volumes and snapshots guide.
FAQ
Does an S3 gateway endpoint cost anything at all?
No. There is no hourly charge and no data processing charge for gateway endpoints to S3 or DynamoDB. Standard S3 request and storage prices apply as before.
Will it change how my application reaches S3?
No. The same hostnames and SDK configuration work. The only difference is the route the packets take inside your VPC. If you use a bucket policy that allows access only from your NAT gateway’s public IP, update it to allow the endpoint (aws:SourceVpce) before the switch, or those requests will be denied.
Can I measure the latency difference?
Yes, from an instance in a private subnet, time a small request before and after (for example aws s3api head-object in a loop) or compare the FirstByteLatency metric on the bucket. The difference per request is small; the gain is largest for workloads that make many requests or move a lot of data in parallel.
Does it help with the NAT gateway’s hourly cost?
Not by itself. The hourly fee is for the gateway existing. If the endpoint takes away most of its traffic, you can decide whether you still need a NAT gateway in every Availability Zone, or at all.
What about Lambda functions in a VPC?
They benefit the same way. A Lambda function attached to private subnets reaches S3 through the subnets’ route tables, so it uses the gateway endpoint once the route exists.
Do this first
Run the two describe commands above. If a private subnet’s route table has no prefix-list route to a vpce-…, create the S3 gateway endpoint for that VPC and attach it to every private route table, then watch the NAT gateway’s BytesOutToDestination metric for a day. The drop is your saving, at $0.045 a gigabyte.
Kostrix runs two checks for this: one prices the NAT data processing line from your own bill, the other lists the VPCs that route through a NAT gateway with no S3 or DynamoDB gateway endpoint, so the account that pays most is the one you fix first, and the next weekly scan shows the line going down.
