AWS cost · Networking

DynamoDB Through a NAT Gateway: The $640 a Month Fix

If your API runs in private subnets and reads from DynamoDB, every response may be passing through a NAT gateway, at $0.045 for each GB it processes. An API reading 14 TB a month pays about $640 for that hop alone. A DynamoDB gateway endpoint carries the same traffic for free, needs no code change, and takes a few minutes to add. Here is how to spot the charge and remove it.

By Jasdeep Bains, SeaGit

·

Key takeaways

  • Pods, tasks and instances in private subnets reach DynamoDB's public endpoint through the NAT gateway unless the VPC has a DynamoDB gateway endpoint.
  • NAT gateway data processing is $0.045 per GB in us-east-1, on top of the hourly charge. 14.3 TB a month of DynamoDB reads costs about $644.
  • Gateway endpoints exist only for DynamoDB and S3, and they cost nothing. They add a route to your route tables; the SDK keeps using the same endpoint name.
  • Look for NatGateway-Bytes in Cost Explorer and compare it with your DynamoDB read volume.
  • A gateway endpoint only covers tables in the same Region as the VPC.

Why DynamoDB traffic goes through NAT

DynamoDB is reached at a public regional endpoint such as dynamodb.us-east-1.amazonaws.com. A workload in a private subnet has no route to the internet except the default route to a NAT gateway. So unless something says otherwise, every DynamoDB request and response passes through that NAT gateway, and AWS bills each gigabyte it processes.

A gateway endpoint says otherwise. It adds a route for DynamoDB's prefix list to the subnet route tables, pointing at the endpoint instead of the NAT gateway. Traffic stays on the AWS network and the NAT processing charge disappears.

What the NAT hop costs

NAT gateway processing for DynamoDB traffic at $0.045 per GB, us-east-1.
DynamoDB traffic a monthThrough NATThrough a gateway endpoint
100 GB$4.50$0
1 TBabout $46$0
10 TBabout $461$0
14.3 TB (100 million 5 KB reads a day)about $644$0

The hourly NAT charge stays, since other traffic still needs the NAT gateway. Only the per-GB processing for DynamoDB goes away. The Vercel vs AWS cost calculator shows this line for your own traffic: switch the gateway endpoint off and the NAT charge appears.

Check whether you are paying it

  • Cost Explorer: group by usage type and look for NatGateway-Bytes (prefixed by the Region code, such as USE1-NatGateway-Bytes). Large values with modest internet traffic point at AWS service traffic going through NAT.
  • Route tables: a private route table with a DynamoDB endpoint has a route whose destination is a prefix list (pl-…) and whose target is a vpce-… endpoint. No such route means DynamoDB traffic goes through NAT.
  • CloudWatch: the NAT gateway's BytesOutToDestination metric should drop as soon as the endpoint is added.

Add the gateway endpoint

With the AWS CLI, attach the endpoint to every private route table in the VPC:

bash
aws ec2 create-vpc-endpoint \
  --vpc-id vpc-0abc123 \
  --vpc-endpoint-type Gateway \
  --service-name com.amazonaws.us-east-1.dynamodb \
  --route-table-ids rtb-0private1 rtb-0private2

Or in Terraform:

hcl
resource "aws_vpc_endpoint" "dynamodb" {
  vpc_id            = aws_vpc.main.id
  service_name      = "com.amazonaws.us-east-1.dynamodb"
  vpc_endpoint_type = "Gateway"
  route_table_ids   = aws_route_table.private[*].id
}

Add the S3 gateway endpoint the same way. It is also free and carries container image layers from ECR, which are stored in S3. No application change is needed: the SDK resolves the same endpoint name, and the route table sends the traffic to the endpoint. An endpoint policy can limit which tables are reachable through it.

Limits to know

  • Same Region only. A gateway endpoint covers DynamoDB in the VPC's own Region. Tables in another Region are still reached through NAT, and cross-Region transfer charges apply.
  • Only inside the VPC. On-premises networks and peered VPCs cannot use another VPC's gateway endpoint. DynamoDB also offers paid interface endpoints for those cases.
  • Only DynamoDB and S3. Other AWS services need interface endpoints, which are charged by the hour and by the GB.

On SeaGit, the DynamoDB and S3 gateway endpoints are checkboxes on the network form, so new clusters start without the NAT charge.

Frequently asked questions

DynamoDB Through a NAT Gateway: The $640 a Month Fix: FAQ

Does a DynamoDB gateway endpoint cost anything?

No. Gateway endpoints for DynamoDB and S3 have no hourly or per-GB charge. You still pay for DynamoDB itself.

Do I need to change my code or SDK configuration?

No. The SDK keeps using the regional DynamoDB endpoint name. The route table sends that traffic to the gateway endpoint instead of the NAT gateway.

Does it work for Lambda functions?

Yes, for functions attached to a VPC. Their traffic follows the subnet route tables, so a gateway endpoint on those tables removes the NAT hop. Functions not attached to a VPC do not use your NAT gateway at all.

Why is my NAT bill still high after adding it?

Other traffic still goes through NAT: pulls from public registries, calls to third-party APIs, and AWS services without a gateway endpoint. Check the S3 endpoint too, and look at the remaining traffic by destination with VPC Flow Logs.

Sources

Checked 17 November 2026.

  1. Gateway endpoints — Gateway endpoints for S3 and DynamoDB, route tables and policies.
  2. Amazon VPC pricing — NAT gateway hourly and data processing charges.
  3. Amazon DynamoDB on-demand pricing — Read request units and data transfer.
  4. Terraform aws_vpc_endpoint — Resource reference for the endpoint above.

Read next