EnorexaEnorexa
Back to blog

Cloud

The $0.045/GB AWS Trap: Why NAT Gateways Quietly Bleed AI Startups

October 25, 20265 min readBy Enorexa Team

Last month, we audited a Series A AI startup whose AWS bill jumped from $4,200 to $19,800 in thirty days without a single new enterprise customer. Their engineering lead assumed runaway GPU inference or RDS IOPS caused the spike. Both guesses were wrong. When we filtered AWS Cost Explorer by Usage Type and isolated USW2-NatGateway-Bytes, we found the real culprit: $11,400 in pure NAT Gateway data processing fees. Every time their private ECS worker tasks pulled a 40MB PDF from S3 for OCR parsing, pushed chunked embeddings back to bucket storage, or pulled a 1.8GB PyTorch container image during an auto-scaling event, AWS routed that internal traffic through a managed NAT Gateway at $0.045 per gigabyte. They were paying a public internet toll to move bytes between two AWS services sitting in the exact same data center.

Why Private Subnets Default to the Expensive Path

Most teams spin up their VPC using standard Terraform modules or the AWS VPC Wizard: public subnets for Application Load Balancers, private subnets for ECS tasks, EKS nodes, and Lambda functions. That isolation model is sound. The trap lies in the private subnet route table. By default, anything outside the local 10.0.0.0/16 CIDR block matches the 0.0.0.0/0 route and heads straight to nat-0a1b2c3d4e5f. Because Amazon S3 and DynamoDB resolve to public IP ranges by default, your private containers treat S3 like an external website. Do the math on an AI document pipeline processing 50,000 multi-page PDFs a day. Reading the raw file into memory, writing extracted page images back to S3, and streaming audit logs easily generates 80TB of monthly transfer. At $0.045 per gigabyte, that is $3,600 a month in NatGateway-Bytes charges before a single packet ever touches the public internet.

The 15-Minute Fix: S3 Gateway Endpoints vs. Interface Endpoints

You fix S3 and DynamoDB bleed with a VPC Gateway Endpoint, not AWS PrivateLink. Engineers routinely confuse the two. Interface Endpoints (PrivateLink) provision Elastic Network Interfaces inside your subnets and bill $0.01 per hour per Availability Zone plus $0.01 per gigabyte processed. Gateway Endpoints (com.amazonaws.us-east-1.s3), on the other hand, cost zero dollars per hour and zero dollars per gigabyte. When you attach an S3 Gateway Endpoint to your private route tables, AWS injects a managed prefix list (pl-63a5400a) directly into your router. The next time @aws-sdk/client-s3 or Python's boto3 requests a presigned object from the same region, traffic takes the private prefix route straight to S3 storage nodes. No NAT traversal. No hourly fee. In our audit, adding four lines of Terraform for aws_vpc_endpoint dropped daily NAT throughput by 74% within ten minutes of terraform apply.

Where Region Mismatches and Container Pulls Still Burn Cash

Adding an S3 Gateway Endpoint fails silently in two specific production scenarios. First, cross-region buckets. If your compute runs in us-west-2 because GPU spot availability was better last quarter, but your legacy production S3 bucket still lives in us-east-1, the Gateway Endpoint does nothing. Prefix lists only route intra-region traffic; cross-region S3 calls fall right back to 0.0.0.0/0 through your NAT Gateway and stack $0.02/GB cross-region transfer fees on top of the $0.045/GB NAT processing charge. Second, Elastic Container Registry (ECR) churn. If a flawed health check causes your ECS service to crash-loop a 2GB Node.js and Playwright container every three minutes across four tasks, pulling layers from ECR through a NAT Gateway will burn hundreds of dollars over a weekend. Because ECR stores actual image layers in S3, pairing your free S3 Gateway Endpoint with Interface Endpoints for ecr.api and ecr.dkr keeps every image pull off the NAT meter.

Killing Multi-AZ NAT Sprawl in Staging Environments

Look at your non-production AWS accounts right now. Nine times out of ten, teams deploy the exact same vpc Terraform module to dev, staging, and qa that they run in prod—complete with three NAT Gateways across three Availability Zones. Each NAT Gateway costs $0.045 per hour just to exist, which works out to roughly $32.85 per month per AZ, or nearly $100 a month per environment before moving a single byte. Multiply that across four preview environments and you are burning $4,800 a year for high-availability failover on staging servers nobody uses at 3:00 AM. Drop non-production environments down to a single NAT Gateway (single_nat_gateway = true), or use an ultra-lean t4g.nano NAT instance ($3.20/month) for dev sandboxes.

Auditing Your VPC Before Next Month's Invoice

Cloud infrastructure should fund your product roadmap, not AWS data transfer margins. Before provisioning larger compute reservations or cutting engineering tools, open AWS Cost Explorer, group by Usage Type, and filter for NatGateway-Bytes and DataTransfer-Regional-Bytes. If data processing fees exceed 8% of your total compute spend, you have a routing leak. At Enorexa, we build lean cloud architectures, high-throughput AI pipelines, and full-stack Next.js and Python systems engineered to scale without surprise infrastructure taxes. If your cloud bill is outpacing user growth, talk to us and we will trace your VPC flow logs and plug the bleed.