AWS Cost Anomaly Detection: a practical FinOps guide

How to use AWS Cost Anomaly Detection to catch unusual AWS spend: monitor types, alert thresholds, Terraform configuration, Slack and EventBridge integration, and FinOps best practices.

CloudScript Technology
November 27, 20269 min read
AWS Cost Anomaly Detection: a practical FinOps guide

AWS Cost Anomaly Detection is the AWS Billing and Cost Management feature that uses machine learning models to spot unusual spend and warn the team before the deviation becomes a surprise on the invoice. For anyone practicing FinOps on AWS, it fills a gap that a fixed budget cannot: the spike nobody predicted, caused by an oversized deploy, a looping job or a forgotten resource left running.

In this guide: how the service works, which monitor to choose, how to tune alerts and how to put it all in code with Terraform.

What AWS Cost Anomaly Detection is

According to the official documentation, the feature evaluates the account's spend patterns with machine learning, accounting for weekly and monthly seasonality and organic growth, precisely to reduce false positives. You do not define what an anomaly is: the model learns the expected behavior and flags what deviates from it.

In practice, it delivers continuous detection by service, account, tag or cost category, alerts by email or Amazon SNS, and root cause analysis across four dimensions: service, account, Region and usage type.

Cost Anomaly Detection is part of Cost Explorer, which must be enabled on the account. Accounts that enabled Cost Explorer from March 27, 2023 onward already get a default configuration: an AWS services monitor and a daily email summary, as described in the service FAQ.

How detection works and what the limits are

Before trusting the alert, it helps to understand what the service sees and with what delay. These points come from the documentation and the official quotas:

  • Frequency: the analysis runs approximately three times a day, after billing data is processed.
  • Delay: data comes from Cost Explorer, which has a latency of up to 24 hours. An anomaly can take up to 24 hours to be detected after the usage happens.
  • Minimum history: at least 10 days of usage data are required. A newly adopted service is only evaluated after that period.
  • Metric analyzed: net unblended cost, that is, after applicable discounts.
  • Out of scope: third-party AWS Marketplace products (except third-party foundation models on Amazon Bedrock) are not monitored. For those cases, AWS itself recommends AWS Budgets.

In November 2025, AWS announced an algorithm based on rolling 24-hour windows, to detect faster and with fewer false positives.

In other words: it is not a real-time alarm. It complements operational metrics and budgets, it does not replace them. A new monitor can also take 24 hours to start detecting.

Monitor types: AWS managed or customer managed

The monitor defines which slice of spend is evaluated. There are two approaches today, described in the getting started guide.

AWS managed monitors

They automatically track every value of a dimension and include new ones as they appear. The available dimensions are:

  • AWS services: evaluates each service used by the account independently. Available in management and member accounts.
  • Linked account: tracks every member account in the organization.
  • Cost allocation tag: tracks each value of a tag key (for example, each team in a team tag).
  • Cost category: tracks each value of a category.

The last three can only be created in the management account. Each managed monitor tracks up to 5,000 values; beyond that, it keeps the 5,000 with the highest spend. The current quota allows one managed services monitor per account and, in the management account, one additional managed monitor (linked account, tag or category).

Customer managed monitors

Previously called custom monitors, they let you choose up to 10 accounts or tag values (or one cost category value), evaluated in aggregate. The quota is 500 per management account.

When to use each one

  • Use AWS managed monitors for broad coverage across your primary cost organization dimension, with minimal maintenance.
  • Keep the services monitor alongside it, for aggregate visibility per service.
  • Use customer managed monitors when a specific group needs a different threshold, such as critical workloads or production environments.

Note: the linked account monitor looks at the account's total spend. If Amazon S3 goes up and Amazon EC2 goes down by the same amount, it does not fire; the services monitor catches that case.

Alerts: frequency and thresholds that do not create noise

Each monitor needs at least one alert subscription, which defines who is notified, how often and above which impact.

  • Individual alerts: sent as soon as the anomaly is detected. They require an Amazon SNS topic (one per subscription).
  • Daily summary: an email with the top 10 anomalies from the previous day, sorted by impact.
  • Weekly summary: one email per week. Summaries accept up to 10 recipients per subscription.

The threshold can be absolute (total impact in dollars) or percentage (difference between expected and actual spend), and the two can be combined with AND or OR. The AWS default configuration, for example, alerts when the anomaly exceeds 40% and US$ 100 above expected spend.

Two important behaviors:

  • The threshold only controls whether the alert is sent. The model keeps detecting anomalies below it, and all of them remain visible in the detected anomalies tab.
  • In AWS managed monitors, the same threshold applies to every tracked value. For granular routing per value, the documentation points to AWS User Notifications with JSON filters.

Combining both with AND is usually the best starting point: it avoids an alert for a 300% increase on a service that costs cents.

Step by step: Cost Anomaly Detection as code with Terraform

Configuring through the console works, but it is neither auditable nor reproducible across accounts. The example below, written by us for the Terraform AWS provider, creates the services monitor, an SNS topic with restricted permission and an individual alert subscription.

  1. Confirm the prerequisites. Cost Explorer enabled and, if you plan to monitor by account, tag or category, execution in the management account.
  2. Check whether a services monitor already exists. Since the quota is one per account, accounts with the default configuration should import the existing monitor into state instead of creating another.
  3. Declare the monitor, topic and subscription:
data "aws_caller_identity" "current" {}

resource "aws_ce_anomaly_monitor" "services" {
  name              = "aws-services"
  monitor_type      = "DIMENSIONAL"
  monitor_dimension = "SERVICE"
}

resource "aws_sns_topic" "cost_anomalies" {
  name = "cost-anomaly-alerts"
}

data "aws_iam_policy_document" "cost_anomalies" {
  statement {
    sid       = "AllowCostAnomalyDetectionPublish"
    effect    = "Allow"
    actions   = ["SNS:Publish"]
    resources = [aws_sns_topic.cost_anomalies.arn]

    principals {
      type        = "Service"
      identifiers = ["costalerts.amazonaws.com"]
    }

    condition {
      test     = "StringEquals"
      variable = "aws:SourceAccount"
      values   = [data.aws_caller_identity.current.account_id]
    }
  }
}

resource "aws_sns_topic_policy" "cost_anomalies" {
  arn    = aws_sns_topic.cost_anomalies.arn
  policy = data.aws_iam_policy_document.cost_anomalies.json
}

resource "aws_ce_anomaly_subscription" "immediate" {
  name             = "immediate-anomalies"
  frequency        = "IMMEDIATE"
  monitor_arn_list = [aws_ce_anomaly_monitor.services.arn]

  subscriber {
    type    = "SNS"
    address = aws_sns_topic.cost_anomalies.arn
  }

  threshold_expression {
    dimension {
      key           = "ANOMALY_TOTAL_IMPACT_ABSOLUTE"
      match_options = ["GREATER_THAN_OR_EQUAL"]
      values        = ["100"]
    }
  }

  depends_on = [aws_sns_topic_policy.cost_anomalies]
}
  1. Restrict who can publish to the topic. The policy above grants SNS:Publish only to the costalerts.amazonaws.com service and only on behalf of your account, via aws:SourceAccount, as recommended in the SNS topic documentation.
  2. Encrypt the topic if company policy requires it. With SSE and AWS KMS, the key policy must also allow kms:GenerateDataKey* and kms:Decrypt for the same service.
  3. Tune the threshold. The US$ 100 value is illustrative. To combine absolute and percentage values, use the ANOMALY_TOTAL_IMPACT_ABSOLUTE and ANOMALY_TOTAL_IMPACT_PERCENTAGE dimensions in a nested expression, as described in the provider documentation.
  4. Apply through a pull request, with a reviewed plan and execution by the pipeline.

Slack integration and automation with EventBridge

Two paths take the anomaly to where the team already works:

  • Chat: the SNS topic for individual alerts can be mapped to a Slack channel or an Amazon Chime chat room through Amazon Q Developer in chat applications. The walkthrough is in Receiving anomaly alerts in chat applications.
  • Events: the service publishes events to Amazon EventBridge with source aws.ce and detail type Anomaly Detected. With a rule, you can open a ticket in your ITSM tool or notify the resource owner.
{
  "source": ["aws.ce"],
  "detail-type": ["Anomaly Detected"]
}

The event carries the impact, the root causes and a direct link to the anomaly details page, enough to build an automated triage flow.

Root cause investigation and the feedback loop

Detecting is half the job. The full cycle has four steps:

  1. Triage. On the details page, review the ranked root causes. The service lists up to 10 contributing factors, with approximate dollar attributions.
  2. Deep dive. Use the link to Cost Explorer and analyze the time series filtered by the root cause.
  3. Assisted explanation. Since June 2026, AWS offers investigation with Amazon Q, which correlates cost data with AWS CloudTrail events to indicate whether the change was usage-driven or rate-driven and which API calls and identities are associated with it.
  4. Assessment. Record in the console whether the anomaly was real or not. This feedback helps improve detection and documents the decision.

For reports and periodic reviews, the query can also be run with the AWS CLI:

aws ce get-anomalies \
  --date-interval StartDate=2026-11-01,EndDate=2026-11-27 \
  --total-impact NumericOperator=GREATER_THAN,StartValue=100

FinOps best practices with Cost Anomaly Detection

  • Treat tags as a prerequisite. A tag monitor is only useful if the cost allocation tag is active and applied consistently.
  • Give every alert an owner. An anomaly with no owner becomes noise. Route by team, account or business unit.
  • Use it together with AWS Budgets. Budgets covers the planned ceiling and the items Cost Anomaly Detection does not analyze; anomaly detection covers the unexpected.
  • Review thresholds periodically. A threshold that never fires, or fires every day, needs tuning.
  • Apply least privilege. Cost data is sensitive. Limit access with IAM and restrict the SNS topic policy.

If your environment runs Kubernetes on AWS, it is worth combining anomaly detection with the practices in our article on FinOps for Kubernetes on AWS.

Frequently asked questions

Does AWS Cost Anomaly Detection have a cost?

Recent AWS announcements about the feature, such as managed monitors and the dashboards widget, state availability at no additional charge. Individual alerts use Amazon SNS, which has its own pricing. Always confirm on the official pricing page before estimating.

How is it different from AWS Budgets?

AWS Budgets compares spend against a value you defined. Cost Anomaly Detection compares it against the pattern learned by the model, with no fixed value. The two complement each other.

Can I use it in member accounts?

Yes, but only with the AWS services monitor. Monitors by linked account, cost allocation tag and cost category can only be created in the management account, and each account only sees the monitors it created.

Conclusion

AWS Cost Anomaly Detection reduces invoice surprises with little configuration: it learns the spend pattern and delivers the likely cause along with the alert. The outcome depends on what surrounds it: consistent tags, calibrated thresholds, alerts with owners and a clear investigation flow.

At CloudScript, we structure this process as part of our FinOps consulting, with declarative configuration, integration with the team's channels and continuous follow-up, backed by 24/7 support. If you want to assess cost governance in your AWS environment, talk to us or write to contato@cloudscript.com.br.


Sources

AWS, Amazon SNS, Amazon EventBridge and other service names are trademarks of Amazon.com, Inc. or its affiliates. CloudScript is an AWS Select Tier partner.

Stay up to date

Get our articles on DevOps, Kubernetes, Platform Engineering and Cloud Native delivered to your inbox.

No spam. Unsubscribe anytime.

CloudScript is a Platform Engineering company focused on enterprise-grade cloud-native application architecture.

No spam. Unsubscribe anytime.
Follow us

24/7 support for contracted clients via OpsScript.

© 2026 CloudScript Technology. All rights reserved.