Skip to content

Cost Anomaly Detection

🧠 What Is AWS Cost Anomaly Detection?

AWS Cost Anomaly Detection is a machine learning–based service that continuously monitors your AWS cost and usage data and automatically detects anomalies (sudden spikes or drops) at the service, account, or tag level.

βœ… It helps you proactively catch billing surprises, such as unintended usage, configuration errors, or cost increases.


πŸš€ Why Use It?

Purpose Benefit
🧭 Early Detection Find unexpected cost spikes before monthly invoice
πŸ“¬ Automatic Notifications Alert you via email or SNS on anomaly detection
🎯 Granular Control Detect anomalies by service, account, or cost center
πŸ” Daily Monitoring Automatic, no manual querying
πŸ“ˆ Visualizations Integrated with Cost Explorer and Budgets

🧱 Core Components

Component Description
Monitor Defines the scope of anomaly detection (e.g., by linked account, service)
Threshold Defines what qualifies as an anomaly (based on historical baseline)
Subscription Defines who gets notified (via email or SNS)
Linked Accounts Detect anomalies per account (useful for AWS Organizations)

🎯 Supported Dimensions for Monitors

You can create a monitor by:

  • Service (e.g., EC2, S3, Lambda)

  • Linked Account (if using AWS Organizations)

  • Linked Account + Service

  • Tag (e.g., Project, Environment)


πŸ”§ How It Works (Workflow)

  1. πŸ“ˆ ML model is trained on past 5 weeks of cost/usage data

  2. 🚨 When usage deviates from normal, an anomaly is flagged

  3. πŸ“¬ You receive an email/SNS alert with anomaly details

  4. πŸ‘€ Investigate the anomaly in the AWS Console or Cost Explorer


πŸ–₯️ Setting It Up (Console Steps)

  1. Go to AWS Cost Anomaly Detection in the console

  2. Click β€œCreate monitor”

  3. Choose:

    • Monitor type (Service, Linked Account, etc.)

    • Name

  4. Create a subscription:

    • Add email addresses or SNS topics for alerts
  5. Review and create


πŸ’¬ Example: Email Alert from Anomaly

You’ll receive something like:

Subject: [Anomaly Detected] EC2 cost for Dev account increased by 260%

Details:
Service: AmazonEC2
Timeframe: June 10 – June 11
Expected Cost: $1.25
Actual Cost: $4.50

πŸ“¦ Terraform (Not yet officially supported directly)

Cost Anomaly Detection does not yet have native Terraform resource support as of 2025, but you can use the AWS SDK or CloudFormation custom resources as a workaround.


πŸ’° Pricing

Feature Cost
Creating Monitors βœ… Free
Receiving Alerts (Email/SNS) βœ… Free
Underlying ML Engine βœ… Free

βœ… AWS Cost Anomaly Detection is entirely free to use.


βœ… TL;DR Summary

Feature AWS Cost Anomaly Detection
Goal Detect and alert on unexpected AWS cost spikes
Uses ML? βœ… Yes (based on 5 weeks of historical data)
Delivery Methods Email, SNS
Monitor by Service, Account, Tag
Frequency Daily check, alerts in near real-time
Cost βœ… Free
Terraform Support ❌ Not yet, but scriptable via SDK