Cost Explorer
Overview
AWS gives you several tools to see, forecast and control your spend. Cost Explorer is the visual tool: it graphs your costs and usage by service, account, Region or tag, and forecasts future spend. AWS Budgets lets you set thresholds and get alerted (or trigger actions) before you overspend.
For deeper analysis there is the Cost and Usage Report (CUR), the most granular dataset AWS provides, delivered to S3 so you can query it with Athena or QuickSight. Cost Anomaly Detection uses machine learning to spot unusual spend automatically.
Finally, two advisory tools help you reduce cost: Trusted Advisor checks your account against best practices, and Compute Optimizer analyses utilisation to recommend right-sized resources. Together with cost allocation tags, these tools make up the day-to-day toolkit of AWS cost management.
Key Concepts
- Cost Explorer visualises up to 13 months of history (and can forecast up to 12 months), with daily, monthly and optional hourly/resource-level granularity.
- AWS Budgets supports cost, usage, RI/Savings Plans utilization and coverage budgets, with alerts via SNS/email and optional budget actions.
- Cost and Usage Report (CUR) is the most detailed billing data, delivered to S3 and queried with Athena/QuickSight/Redshift.
- Cost Anomaly Detection uses ML to detect unusual spend and alerts through SNS/email; the service is free.
- Cost allocation tags must be activated in the Billing console before they show in reports; they are not retroactive.
- Trusted Advisor checks cost optimisation, performance, security, fault tolerance, service limits and operational excellence; full checks need Business/Enterprise support.
- Compute Optimizer gives ML-based right-sizing for EC2, ASG, EBS, Lambda, ECS on Fargate and more; memory metrics need the CloudWatch agent.
- AWS Organizations consolidated billing aggregates accounts, shares volume tiers and RI/Savings Plan discounts.
Detailed Notes
The cost management toolbox
| Tool | Purpose | Key facts |
|---|---|---|
| Cost Explorer | Visualise and forecast | 13 months history; 12-month forecast; filter/group by service, account, tag, Region; RI/SP recommendations; API requests cost about $0.01 each |
| AWS Budgets | Alert and act | Cost, usage, RI/SP utilization & coverage; forecasted alerts; budget actions (apply IAM/SCP, stop EC2/RDS); first 2 action-enabled budgets free |
| Cost and Usage Report | Raw detail | Hourly/daily line items, resource IDs, tags; delivered to S3 (Parquet/CSV); basis for Athena/QuickSight; now also via Data Exports |
| Cost Anomaly Detection | Find surprises | ML monitors (per service, account, tag, Cost Category); alert subscriptions (immediate, daily, weekly) |
| Cost Categories | Group costs | Rule-based grouping by team or product |
| Pricing Calculator | Estimate before building | Replaces the older Simple Monthly Calculator and TCO tool |
| Trusted Advisor | Best-practice checks | Five categories plus operational excellence; see below |
| Compute Optimizer | Right-sizing | ML on CloudWatch metrics; default 14-day look-back |
Cost allocation tags
Tags let you attribute spend to a team, project or environment.
- AWS-generated tags (such as
aws:createdBy) and user-defined tags must be activated in Billing -> Cost allocation tags. - Activation takes up to 24 hours and only affects costs from that point forward.
- Enforce consistent tagging with Tag Policies (Organizations), SCPs and AWS Config rules such as
required-tags.
Budgets example
{
"BudgetName": "monthly-prod-cost",
"BudgetType": "COST",
"TimeUnit": "MONTHLY",
"BudgetLimit": { "Amount": "5000", "Unit": "USD" },
"CostFilters": { "TagKeyValue": ["user:Environment$prod"] }
}
Notifications can be sent on actual spend (for example at 80%) and on forecasted spend (for example at 100%) to an SNS topic, which can drive Lambda or chat notifications. Budget actions can automatically attach a restrictive IAM or SCP policy, or stop EC2 and RDS instances, when a threshold is crossed.
Trusted Advisor
Trusted Advisor inspects the account and reports green/amber/red checks.
| Support plan | Checks available |
|---|---|
| Basic / Developer | Core checks only (a small set of security checks and service quotas) |
| Business / Enterprise On-Ramp / Enterprise | All checks, programmatic access via the Support API, EventBridge integration |
Typical cost checks: idle or low-utilisation EC2 instances, unassociated Elastic IPs, idle load balancers, underutilised EBS volumes, RI/Savings Plans optimisation.
Compute Optimizer
- Classifies resources as under-provisioned, over-provisioned or optimized and projects savings and performance risk.
- Supports EC2, Auto Scaling groups, EBS volumes, Lambda functions, ECS services on Fargate, RDS and commercial software licences.
- Needs opt-in (can be organisation-wide). Memory utilisation requires the CloudWatch agent. Enhanced infrastructure metrics extend the look-back to three months for an additional charge.
Which tool answers which question?
| Question | Tool |
|---|---|
| What did we spend last quarter, by team? | Cost Explorer (with tags) |
| Alert me if the monthly bill will exceed $5,000 | Budgets (forecasted alert) |
| I need every line item with resource ID for chargeback | CUR + Athena |
| Why did spend spike on Tuesday? | Cost Anomaly Detection / Cost Explorer daily view |
| Are my instances oversized? | Compute Optimizer |
| Do I have idle ELBs or unattached EIPs? | Trusted Advisor |
Real World Example
Scenario — a software company with 40 AWS accounts and no cost accountability.
Finance complains that the monthly AWS bill varies by 30% and nobody knows which product team caused the increase. The cloud platform team creates an AWS Organization with consolidated billing, enforces a mandatory CostCenter and Environment tag using tag policies and AWS Config, and activates them as cost allocation tags.
They enable the Cost and Usage Report into a central S3 bucket and build an Athena/QuickSight dashboard for monthly showback per team. Each team gets a Budget with forecasted alerts to its Slack channel through SNS and Chatbot. Cost Anomaly Detection monitors per service and caught a runaway Lambda retry loop within hours instead of at month-end.
Every quarter, Compute Optimizer and Trusted Advisor reports feed a right-sizing sprint, removing idle load balancers and downsizing over-provisioned instances, which cuts the bill by about 22%.
Architecture Diagram
Usage and tags feed reporting, alerting and optimisation tools.
- 1Resources are tagged and the tags are activated as cost allocation tags.
- 2Cost Explorer, Budgets and Cost Anomaly Detection analyse the usage data and detect threshold breaches or anomalies.
- 3The Cost and Usage Report is written to S3 and queried with Athena or QuickSight for chargeback.
- 4Alerts reach teams through SNS, and Trusted Advisor and Compute Optimizer suggest where to cut waste.
Best Practices
- ✓Define a tagging strategy (CostCenter, Environment, Owner), activate the tags, and enforce them with tag policies and AWS Config.
- ✓Use separate accounts per workload or environment inside an Organization for natural cost boundaries.
- ✓Create Budgets for every account and team with forecasted alerts, not just actual-spend alerts.
- ✓Enable the CUR (or Data Exports) early; data is not backfilled before the report is created.
- ✓Turn on Cost Anomaly Detection with monitors per service and per account and send alerts to a shared channel.
- ✓Run Compute Optimizer and Trusted Advisor reviews on a schedule, and install the CloudWatch agent for memory metrics.
- ✓Review Savings Plans/RI utilization and coverage monthly and ladder purchases.
- ✓Use Budget actions for sandbox accounts to automatically restrict spend.
Common Interview Questions
Exam Tips
SAA-C03 focus
- "Visualise and forecast costs" -> Cost Explorer; "alert when cost exceeds threshold" -> AWS Budgets.
- "Most detailed billing data / analyse with Athena" -> Cost and Usage Report.
- "Detect unusual spend automatically" -> Cost Anomaly Detection (machine learning).
- "Allocate cost per department/project" -> cost allocation tags (must be activated).
- "Idle load balancers, unassociated Elastic IPs, low-utilisation EC2" -> Trusted Advisor.
- "Recommend right-sized instance types from utilisation" -> Compute Optimizer.
- "Combine billing and share RI/Savings Plan discounts" -> Organizations consolidated billing.
- Budgets can be forecasted and can trigger actions; Cost Explorer cannot.
Chapter quiz
Cost Optimization · 5 questions
1.A company runs a nightly data-processing job on EC2. The job is stateless, can be restarted, and the start time is flexible. Which purchasing option gives the LOWEST cost?
2.A company expects to move workloads from EC2 to AWS Fargate and Lambda over the next two years and wants a discount on all compute without managing individual reservations. What should they buy?
3.A steady-state Amazon RDS for MySQL database has run on the same instance class for two years. How can the company reduce cost for the next three years?
4.A finance team wants an automatic email when the forecasted monthly spend of a project is expected to exceed $10,000, and wants the project's costs broken down by team tag. Which combination is MOST appropriate?
5.An application in a private subnet downloads large amounts of data from Amazon S3 in the same Region through a NAT Gateway, resulting in high data processing charges. What is the MOST cost-effective fix?
0 of 5 answered
Finished this lesson?
0 of 64 lessons done · 0% of the course

