Read a NAT gateway bill line by line, find the traffic behind it, and remove the expensive part with VPC endpoints, fewer gateways per environment and fewer AWS environments.

A NAT gateway lets containers in a private subnet call the internet without being reachable from it. Almost every production VPC has one, and for a while it is a quiet line on the bill. Then someone opens Cost Explorer and finds that NatGateway-Bytes costs more than the database.
The hourly charge is usually small next to the per-GB processing fee, which applies to every byte that passes through, including traffic to S3 and ECR that never leaves AWS, and it applies again in every environment you run. This guide shows how to find that traffic and the changes that remove most of it.
VPC pricing in us-east-1:
Two zonal gateways for high availability cost about $66 a month before any traffic. Push 2 TB of container image pulls and S3 uploads through them and the processing fee adds about $92, all of it for traffic to AWS's own services.
The regional availability mode, launched in November 2025, removes the need to create one gateway per AZ and edit route tables when workloads move. It simplifies setup but bills each active AZ at the same hourly rate, so it does not change the per-GB math.
Start in Cost Explorer, grouped by usage type, filtered to NatGateway-Bytes and NatGateway-Hours. That tells you which gateways are expensive, not why. For the why, turn on VPC Flow Logs for the NAT gateway's network interface and group by destination.
Query the logs with Athena, sum bytes by destination address, and map the top addresses to services using the published AWS IP ranges. In most VPCs the top destinations are S3, ECR (which stores image layers in S3), CloudWatch Logs and a handful of external APIs.
Gateway endpoints for S3 and DynamoDB are free and route that traffic around the NAT gateway through the route table. There is no reason not to add them.
Interface endpoints (PrivateLink) for ECR, CloudWatch Logs, SQS or Secrets Manager are not free. Each costs about $0.01 per hour per AZ plus $0.01 per GB, so two AZs come to roughly $15 a month per service. They pay off when a service moves more than a few hundred GB a month through the gateway, and ECR's API and Docker endpoints are the usual first pair for container workloads, since image layers already go through the free S3 gateway endpoint once it exists.
Each environment with its own VPC carries its own gateways. Three always-on development or staging VPCs with two gateways each cost about $200 a month in hourly charges before a single byte. Options, in order of impact: run non-production environments with one gateway instead of one per AZ, move short-lived environments out of AWS, and delete environments nobody has deployed to in a month.
Keep tasks in the same AZ as the gateway their subnet routes to. A route table in subnet A pointing at a gateway in zone B pays cross-AZ transfer on every byte.
Best fit: any VPC where NatGateway-Bytes is a top-ten line item. The S3 gateway endpoint alone often removes half of it.
Encore brings infrastructure from code, and each AWS environment it provisions follows the layout described in the AWS infrastructure docs: a VPC across two Availability Zones, an ALB, an Internet Gateway and a NAT gateway in the public subnet, Fargate or EKS compute in private subnets, and databases in an isolated storage subnet. Services declared in code, such as a bucket or a topic, become S3, SNS and SQS resources in that VPC's account.
package exports
import "encore.dev/storage/objects"
// On AWS this is an S3 bucket in your account. Uploads from Fargate tasks
// skip the NAT processing fee once the VPC has an S3 gateway endpoint.
var Reports = objects.NewBucket("reports", objects.BucketConfig{
Versioned: false,
})
The VPC is yours, so the fixes above apply directly: add an S3 gateway endpoint to the environment's private route tables in the AWS console, and interface endpoints if your traffic justifies them. Encore's configuration docs describe PATCH-style updates that leave resources it does not manage alone, so endpoints you add stay in place across deploys. Preview environments run on Encore's hosting by default rather than in your account, which keeps pull-request environments from adding a VPC and NAT gateway each.
When an agent adds a bucket or a topic, the change is a few lines of Go that run against local infrastructure first, and the networking around it stays the same reviewed layout in every environment.
Best fit: teams that want production on AWS in their own account with one consistent network layout per environment, and pull-request environments that do not each need a VPC.
Add S3 and DynamoDB gateway endpoints today; they are free. Add ECR and Logs interface endpoints when flow logs show hundreds of GB a month going to them. Collapse non-production environments to one gateway, or out of AWS. If you run on Encore, the same endpoints can be added to the environment VPC, and the number of AWS environments you pay gateway hours for is the number of environments you created in your account.
In us-east-1 a NAT gateway costs $0.045 per hour, about $33 a month, plus $0.045 for every GB it processes, in either direction. Standard data transfer charges apply on top, such as $0.09 per GB for traffic to the internet. A regional NAT gateway bills the hourly rate for each Availability Zone it is active in.
Usually because traffic to AWS services such as S3, ECR or DynamoDB is going through the NAT gateway and paying the per-GB processing fee. Container image pulls, log shipping and backups to S3 are common sources. Cross-AZ traffic to a gateway in another zone adds data transfer charges as well.
Add free gateway VPC endpoints for S3 and DynamoDB, add interface endpoints for high-volume services like ECR when the traffic justifies their hourly cost, keep traffic in the same AZ as its gateway, and remove NAT gateways from environments that do not need outbound internet access.
Yes. Encore puts compute in private subnets and adds a NAT gateway in the public subnet so services can reach external APIs. The VPC is in your account, so you can add VPC endpoints to it, and preview environments are hosted by Encore by default instead of in your AWS account.
Deploy to your cloud on AWS and Google Cloud
without managing infrastructure
Encore lets developers and agents define application infrastructure directly in code, then automatically provisions it from local development to production in your AWS or GCP account.