Lesson 3 of 4 Cost Governance and Visibility

Monitoring Costs with Cost Explorer, Anomaly Detection and the CUR

This lesson explains the AWS tools for cost trends and forecasts, alerts, anomaly detection, recommendations and detailed resource-level analysis.

Learning outcomes

After completing this lesson, you will be able to:

  • Choose between Cost Explorer, Budgets and Cost Anomaly Detection.
  • Describe Cost Optimization Hub and Compute Optimizer recommendations.
  • Analyse resource-level costs with the Cost and Usage Report.

Visibility, alerts and anomalies

Cost management starts with seeing where money goes. AWS Cost Explorer shows cost and usage over time by service, account, tag or cost category, forecasts future spend from past trends, and recommends rightsizing and commitments. It answers questions such as which service grew last month and which team caused it.

Visibility alone relies on someone looking, so alerts complete it. AWS Budgets tracks cost, usage, and the coverage and utilisation of Reserved Instances and Savings Plans, and alerts on actual or forecast values; its budget actions can apply an IAM policy or SCP, or stop EC2 and RDS instances, when a budget is exceeded, which turns a budget into a guardrail. Cost Anomaly Detection uses machine learning to flag spending that is unusual for a service, account, tag or cost category, with hints at the root cause, which catches problems such as a runaway job within a day rather than at month end. CloudWatch billing alarms on the EstimatedCharges metric, in us-east-1, provide a simple account-level threshold.

Recommendations and detailed data

Several tools say what to change. Cost Optimization Hub consolidates savings recommendations, such as rightsizing, idle resources, commitments and Graviton migration, across all accounts, with estimated savings that account for existing discounts, so the largest opportunities are visible in one list. Compute Optimizer analyses utilisation and recommends sizes for EC2 instances, Auto Scaling groups, EBS volumes, Lambda functions, ECS services on Fargate and RDS databases. S3 Storage Lens shows storage usage and activity across the organisation.

For questions the consoles cannot answer, the detailed data is exported. CUR 2.0, delivered through Data Exports, writes hourly, per-resource cost and usage to S3 in Parquet, where Athena queries it and Amazon Quick Sight visualises it, for example with the Cloud Intelligence Dashboards. FOCUS exports use a standard schema shared with other cloud providers, which suits organisations that report across clouds. The following table summarises the tools.

ToolWhat it does
AWS Cost ExplorerCost and usage over time by service, account, tag or cost category; forecasts; rightsizing and commitment recommendations
AWS BudgetsCost, usage, and RI and Savings Plans coverage and utilisation, with actual or forecast alerts; budget actions apply IAM policies or SCPs or stop EC2 and RDS
Cost Anomaly DetectionML-detected unusual spending, with monitors by service, account, tag or cost category, and root-cause hints
Cost Optimization HubConsolidated recommendations across accounts with estimated savings
Compute OptimizerRightsizing for EC2, Auto Scaling groups, EBS, Lambda, ECS on Fargate and RDS
CUR 2.0 (Data Exports)Hourly, per-resource data to S3 in Parquet for Athena and Quick Sight; FOCUS exports across clouds
S3 Storage LensOrganisation-wide storage usage and activity
CloudWatch billing alarmsAlerts on EstimatedCharges (in us-east-1)
Worked example

Finding where NAT gateway money goes

The monthly bill shows a large and growing NAT gateway line. Cost Explorer confirms the trend but cannot say which accounts and resources drive it. CUR 2.0 data in S3, queried with Athena, can:

SELECT line_item_usage_account_id                       AS account,
       line_item_resource_id                            AS nat_gateway,
       round(sum(line_item_usage_amount), 0)            AS gb_processed,
       round(sum(line_item_unblended_cost), 2)          AS cost
FROM   cur2
WHERE  billing_period = '2026-09'
  AND  line_item_usage_type LIKE '%NatGateway-Bytes'
GROUP BY 1, 2
ORDER BY cost DESC
LIMIT 10;

The top NAT gateway belongs to a data-processing account. VPC Flow Logs for its subnets show most of the traffic going to S3 prefixes. An S3 gateway endpoint removes that traffic from the NAT gateway entirely, at no cost. A Cost Anomaly Detection monitor on that account would have flagged the growth weeks earlier.

Check yourself

What does Cost Anomaly Detection do?

Show answer

It learns normal spending patterns for each monitor and alerts the owners when spend is unusual, so unexpected costs are found within days rather than at month end.

Exam Tips

Remember for the exam

  • For hourly cost analysis at the level of resources, use CUR 2.0 (Data Exports) with Athena.
  • To detect unusual spending by a team, use Cost Anomaly Detection with a tag or cost category monitor.
  • For an automatic guardrail when a budget is exceeded, use Budget actions.
  • To track Savings Plans utilisation and coverage, use AWS Budgets.
  • For one place to see optimisation recommendations, use Cost Optimization Hub.