It's 9am. You open AWS Cost Explorer and see your daily spend jumped from $1,200 to $41,000 overnight. Your stomach drops. You have no idea what caused it and your CTO is already asking questions.
This happens more often than you'd think. Here's exactly how to diagnose it, what the most common causes are, and how to make sure it never catches you off guard again.
Step 1: Pinpoint the service
Open AWS Cost Explorer and set the date range to the last 7 days. Group by Service. You're looking for the bar that's 10-100x taller than the others. In most overnight spikes, it's one of: EC2, Data Transfer, RDS, or — increasingly — Bedrock.
Once you've identified the service, drill down. In Cost Explorer, click the service name and group by Usage Type. This shows you exactly what kind of usage spiked — BoxUsage:c5.4xlarge vs DataTransfer-Out-Bytes vs RDS:db.r5.2xlarge. The usage type is your first real clue about root cause.
Step 2: Go to CloudTrail
Cost Explorer tells you what service and usage type, but not who did it or why. For that, go to CloudTrail → Event History. Filter by event time (last 24 hours) and by the relevant service. For an EC2 spike, filter for RunInstances events. For RDS, look for CreateDBInstance or RestoreDBInstanceFromDBSnapshot.
The CloudTrail event gives you:
- Who: the IAM user, role, or access key that made the call
- What: exactly which API call (RunInstances, with instance type, count, region)
- When: precise timestamp
- Where: source IP address (critical for credential theft investigations)
If you find RunInstances with GPU instances (p3, p4, g4) in a region you've never used before, that's a credential compromise. Stop diagnosing and start your security incident response. Rotate the affected credentials immediately.
Common Cause #1: Auto Scaling gone wrong
The most common cause of overnight spikes that aren't security incidents is a broken Auto Scaling Group. Someone updated the scaling policy, misconfigured a metric, or the alarm threshold was set too low relative to normal traffic variance.
What to look for in CloudTrail: a burst of RunInstances events from autoscaling.amazonaws.com as the principal. Check the ASG configuration — specifically MinSize, MaxSize, and the target tracking or step scaling policy. A target tracking policy set to CPU > 30% during a legitimate traffic spike can legitimately scale to max capacity. Ask: is the MaxSize set high enough to be dangerous?
Fix: add a CloudWatch billing alarm at 50% of your expected monthly spend. It won't tell you why, but it'll wake you up.
Common Cause #2: Missing Spot configuration
Your CI/CD pipeline or batch job was running on Spot instances, which cost 70-90% less than On-Demand. Someone changed the launch template or fleet request — maybe during a config migration, maybe "just to test something" — and removed the Spot specification. The job ran overnight on On-Demand.
A typical ML training job that costs $180 on Spot can cost $1,200 on On-Demand. Run it nightly for a week and you're staring at an unexpected $7,000 line item.
What to look for: RunInstances events with instanceMarketOptions absent (On-Demand) vs "marketType": "spot". If your batch jobs were running Spot yesterday and On-Demand today, that's your culprit.
Common Cause #3: Forgotten test environment
A developer spun up a new environment — a full stack with RDS, ElastiCache, a few EC2 instances — for a proof of concept or a client demo. The demo happened. The environment did not get torn down.
This one is almost impossible to catch with Cost Explorer alone because the spend looks "normal" per-resource — it's not a spike in any one instance type, it's just more of everything. The tell is a new set of resource tags (or missing tags entirely) showing up in your Cost Explorer tag breakdown.
Fix: enforce tagging policies with AWS Config. Any EC2 or RDS instance without an Environment tag should fire a compliance alert. Better yet, schedule an automatic nightly shutdown of anything tagged Environment=dev or Environment=test.
Common Cause #4: Data transfer you didn't know existed
Data transfer costs are the sneakiest. They don't show up as a named EC2 instance you can terminate. They accumulate as DataTransfer-Out-Bytes or — the really expensive ones — DataTransfer-Regional-Bytes for cross-AZ traffic.
If a service was accidentally routing inter-AZ traffic through a path that crosses AZ boundaries (a common Kubernetes misconfiguration), you can rack up significant charges with zero new instances launched. In CloudTrail, this won't show you a RunInstances call — the traffic was already happening, just via a different path.
For data transfer spikes, go to Cost Explorer → group by Usage Type and look for anything with "Bytes" in the name. Then correlate with VPC Flow Logs if you have them enabled.
The real problem: you found out at 9am
All of these root causes have something in common: they started hours or days before you noticed. AWS Cost Anomaly Detection is the built-in solution, but it has a 24-48 hour lag — it runs on the daily billing cycle, not in real time. By the time it emails you, the damage is done.
Real-time detection means monitoring at the API layer, not the billing layer. When a RunInstances call fires in a region you've never used, you know in minutes — before 87 more RunInstances calls follow it. The difference between a $500 incident and a $40,000 incident is often a matter of how many hours passed before someone noticed.
The most important metric in AWS incident response isn't MTTR (mean time to resolution). It's MTTD — mean time to detection. Every hour of undetected runaway spend costs money that you cannot get back.
If you're running a production AWS environment and your only cost monitoring is a manual check of the Cost Explorer console, you're flying blind. At minimum, set a billing alarm in CloudWatch. For anything beyond that, look at whether your monitoring stack can detect API-level anomalies in real time — not just billing aggregates the next morning.
Related articles
Spot vs On-Demand: when the math works
Spot is cheaper per hour, not always per unit of finished work. The break-even math, where it holds, and the traps that erase the savings.
Bought the wrong Savings Plan? You have a short window to return it
AWS lets you return a mistaken Savings Plan for a limited time. The exact rules, the calendar-month trap, and which plans cannot be returned.
The access key nobody retired: how to find and kill stale AWS keys
A vendor key, never retired, found in their environment. Audit commands to find unused AWS access keys, check what they did, and retire them safely.
Protect your AWS account — 14-day free trial
Real-time threat and cost anomaly detection. Detects credential theft, cryptomining, and runaway costs in under 15 minutes. 5-minute setup via CloudFormation.
No credit card. Cancel anytime.