Live
Zero‑Shot ML from Pandas Using the New BigQuery AccessorLive enterprise data access via Gemini Data Cloud connectorsGitLab 19.5 GA of MCP server expands AI agent integration for DevOps pipelinesServerless Model Context Protocol Gateway on Amazon ECS FargateRemote Claude Code Execution on Amazon Bedrock AgentCore with Built-in Data ControlsClosing the Open Source Remediation Gap with Lightwell LessonsAgent Simulation Beta Enables Engineers to Validate Prompt, Model, and Tool Changes Pre‑DeployAWS Continuum GA Brings Code Vulnerability Automation to Two RegionsZero‑Shot ML from Pandas Using the New BigQuery AccessorLive enterprise data access via Gemini Data Cloud connectorsGitLab 19.5 GA of MCP server expands AI agent integration for DevOps pipelinesServerless Model Context Protocol Gateway on Amazon ECS FargateRemote Claude Code Execution on Amazon Bedrock AgentCore with Built-in Data ControlsClosing the Open Source Remediation Gap with Lightwell LessonsAgent Simulation Beta Enables Engineers to Validate Prompt, Model, and Tool Changes Pre‑DeployAWS Continuum GA Brings Code Vulnerability Automation to Two Regions
AWS

Scaling Serverless Cost Anomaly Detection Across 14,000 AWS Accounts

AI SummaryPowered by AI

BMW Group added an automated, serverless cost anomaly detection pipeline that forecasts daily spend per account‑service pair and emails owners when actual costs deviate from the forecast. This matters to engineers because it shows a scalable way to embed fine‑grained FinOps monitoring into daily operations without large compute costs.

Cost anomaly detection at BMW Group moved from static dashboards to an automated, serverless pipeline that forecasts daily spend for each account‑service pair and emails owners when actual costs fall outside the predicted confidence interval. Practitioners care because the pattern shows how to scale fine‑grained FinOps monitoring across thousands of cloud accounts while keeping compute spend under $50 per month.

Forecasting baseline with Prophet

CLEA pulls daily billing rows from AWS Cost and Usage Reports (CUR) and equivalent exports from other providers, then aggregates the roughly 3 billion rows per month to a single grain: daily cost per account per service. Each account‑service combination—hundreds of thousands in total—gets a 365‑day history that feeds an open‑source Prophet model. The model produces a 12‑month rolling forecast and a per‑day expected value with confidence bounds, allowing the system to adapt to each service’s usage pattern rather than applying a one‑size‑fits‑all threshold.

Serverless orchestration with Step Functions and Lambda

A daily Step Functions state machine kicks off the run. A first Lambda discovers active accounts, writes the list as JSON to Amazon S3, and hands it to a Distributed Map state. The map fans out to as many as 500 concurrent Lambda invocations, each responsible for forecasting all services of a single account. This parallelism completes the full 14 000‑account workload in roughly 20 minutes, and the entire compute footprint costs about $50 per month.

From forecast to actionable alert

After a forecast is generated, CLEA computes impact as actual spend – expected spend. When the actual value lies outside Prophet’s confidence interval, the day is marked as a potential anomaly. A downstream filter evaluates the magnitude and business relevance of the impact before triggering an email to the account owner. This two‑step approach—statistical flag followed by business‑logic filter—reduces noise compared to a static dollar‑threshold rule.

Related CloudNinjas coverage: AWS.

What This Means For Practitioners

Implementing a similar pipeline requires:

  • Reliable ingestion of cost data (e.g., CUR) and a consistent aggregation step.
  • A forecasting component that can be swapped without touching detection logic.
  • Serverless orchestration capable of fan‑out parallelism (Step Functions + Lambda) to keep runtime and cost low.
  • Alert‑filtering logic that balances sensitivity with alert fatigue.

Key considerations for future evaluation include monitoring model drift as spending patterns evolve, extending the approach to other cloud providers, and integrating alerts with existing incident‑response tooling. The architecture demonstrates that large‑scale, per‑service cost anomaly detection is feasible with modest operational overhead.

Originally published atAWS Machine Learning Blog