Most surprise four- or five-figure AWS bills don't come from sudden viral traffic. They usually come from three small config mistakes that default tutorials leave out, and they tend to happen overnight while nobody is watching.
While studying AWS architecture and putting together pre-deploy checklists, I mapped out the math behind these three traps and the simplest Terraform and CLI fixes for each one.
If you want to plug in your own traffic numbers, I built a small client-side AWS NAT Gateway and Lambda loop cost calculator that runs in the browser with no signup.
1. Sending S3 and DynamoDB traffic through a NAT Gateway
If you run EC2 instances, ECS tasks, or VPC-attached Lambdas inside a private subnet and they read or write to S3 or DynamoDB, AWS routes all of that traffic through your NAT Gateway by default.
In US East, US West, and EU West, NAT Gateways charge around $0.045 per GB processed on top of the hourly rate.…