aws_ nat_ gateway cost estimation
A managed NAT gateway for outbound internet access from private subnets. Notoriously expensive: $0.045/hour plus $0.045/GB processed.
An aws_
Pricing has two components, both at the same rate, which is the trap. First, $0.045 per hour just for the gateway existing (~$32/month per NAT). Second, $0.045 per GB of data processed (in either direction). A workload that pulls 1 TB/month through the NAT for software updates and external API calls pays $32 for the gateway plus $45 for data processing, totaling $77/month per gateway.
The processing fee compounds badly at scale. A microservices architecture where every service pulls dependencies from npm, downloads container images from external registries, or makes outbound API calls can easily push 50-100 TB/month through NAT gateways, costing $2,250 to $4,500 monthly just for NAT.
Production-grade VPCs typically have one NAT gateway per availability zone for high availability, multiplying the base cost. A 3-AZ deployment is $96/month minimum before any data.
c3x estimates the per-hour cost from the resource. Data processing is usage-based and requires c3x-usage.yml to estimate.
Terraform example
A minimal but realistic configuration that C3X can estimate.
resource "aws_eip" "nat" {
domain = "vpc"
}
resource "aws_nat_gateway" "main" {
allocation_id = aws_eip.nat.id
subnet_id = aws_subnet.public.id
tags = {
Name = "production-nat"
}
}Pricing dimensions
What you actually pay for when you provision aws_.
| Dimension | Unit | What's being charged |
|---|---|---|
| NAT gateway hours | per hour | Flat hourly rate for the gateway to exist. $0.045/hour ≈ $32.85/month |
| Data processed | per GB | Bytes flowing through the gateway in either direction. Add expected volume to c3x-usage.yml. $0.045/GB |
| Elastic IP | per hour | Each NAT gateway needs an aws_ |
Optimization tips
Common ways to reduce aws_ cost without changing the workload.
Add VPC endpoints for S3 and DynamoDB
Up to 100% on S3/DynamoDB trafficVPC Gateway Endpoints for S3 and DynamoDB are free. Any S3 or DynamoDB traffic from private subnets bypasses the NAT entirely. For workloads that read/write S3 heavily, this can cut NAT bills by 50%+.
Add Interface endpoints for chatty AWS services
Service-dependentInterface VPC Endpoints (~$7/month per endpoint per AZ) route traffic to ECR, Secrets Manager, KMS, etc. through PrivateLink instead of NAT. Cheaper than NAT processing fees if you're moving more than ~10 GB/month per service.
Pull container images from ECR, not Docker Hub
Workload-dependentEach EKS or ECS node pulling images from external registries pays NAT data processing on every pull. Mirroring to ECR + VPC endpoint eliminates this cost.
Use a single NAT gateway for non-production environments
$64/month per non-prod VPCMulti-AZ NAT gateways are right for production. For dev/staging, one NAT in a single AZ is fine and cuts the base cost from $96/month to $32/month.
Consider a NAT instance for very small workloads
Up to 95% for tiny workloadsA t4g.nano running fck-nat or similar costs ~$3/month plus minimal data transfer. Not HA, but fine for personal projects or non-critical workloads.
FAQ
Why is my NAT gateway my biggest AWS bill item?
Two reasons. First, the per-GB processing fee is the same as the per-hour rate but compounds with volume. Second, microservices architectures route a surprising amount of traffic through NAT (image pulls, API calls, package installs) that engineers don't think about. c3x's recommend command flags NAT-heavy patterns.
Are VPC endpoints really free for S3?
S3 and DynamoDB Gateway Endpoints have no hourly charge and no data processing fee. They're a strict cost win if you have any S3 or DynamoDB traffic at all from private subnets. Interface endpoints to other AWS services have hourly + per-GB charges but are still usually cheaper than NAT for that traffic.
Does c3x estimate NAT data processing?
Only if you add expected GB/month to c3x-usage.yml under the NAT gateway resource. Without it, c3x shows the hourly cost and flags processing as usage-dependent.
Should I replace NAT with VPC Lattice or PrivateLink?
Both are alternatives for specific traffic patterns. PrivateLink is right for accessing specific external services (other AWS accounts, partner SaaS). VPC Lattice is for service-to-service communication within and across VPCs. Neither fully replaces NAT for general internet egress.
Related resources
More AWS resources
Further reading
- How many NAT gateways do I need? Balancing cost and availability
A NAT gateway costs about 32 to 45 dollars a month plus per-GB processing, and the naive high-availability setup runs one per availability zone. Knowing when you need that redundancy and when one gateway is fine saves real money. Here is the tradeoff.
- PrivateLink cost explained: private connectivity and its price
AWS PrivateLink gives private, secure access to services without traversing the public internet, but interface endpoints bill an hourly fee per endpoint per AZ plus a per-GB data processing charge. Here is how the cost works and when it pays off.
- How much does it cost to run a SaaS app with 1,000 users?
A small B2B SaaS with 1,000 users, a managed database, a cache, and a CDN lands around 195 dollars a month on AWS. Here is the full component-by-component breakdown, the assumptions behind it, and where the money actually goes.
- How to estimate AWS costs from Terraform before deploying
From a single CLI command to PR comments in CI that block over-budget merges, this is the practical guide to Terraform cost estimation. No AWS credentials, no terraform plan, no SaaS account.
Estimate this resource in your own Terraform
Free, open source, no API key. C3X parses your Terraform and shows line-item cost for every resource, including aws_.