Reading25 min read·Module 4High exam weight

AWS Cost Explorer & Budgets

Key concepts

  • Cost Explorer reports

  • Rightsizing recommendations

  • Reserved Instance coverage

  • AWS Budgets alerts

  • Cost allocation tags

Overview

AWS Cost Explorer and AWS Budgets are the primary tools for understanding, analyzing, and controlling AWS costs. Cost Explorer provides visualization and analysis of your spending patterns, while AWS Budgets allows you to set custom cost and usage thresholds with automated alerts and actions. Together, they form the foundation of AWS cost governance for the SAA-C03 exam.

Core Concept

AWS Cost Explorer analyzes historical spend (up to 12 months) and forecasts future costs (up to 12 months). AWS Budgets sets thresholds and triggers alerts/actions when actual or forecasted costs exceed limits. Cost Explorer provides rightsizing recommendations and Reserved Instance/Savings Plans reports to identify optimization opportunities. Use cost allocation tags to track spending by project, team, or environment.

Exam Tip

When exam questions mention 'analyze spending patterns', 'visualize costs', or 'forecast future costs', the answer is Cost Explorer. When questions mention 'alert when costs exceed', 'automate cost controls', or 'prevent budget overruns', the answer is AWS Budgets. Questions about 'track costs by project or department' require cost allocation tags.

Key Concepts

AWS Cost Explorer

AWS Cost Explorer Features Overview
Figure 1: Cost Explorer Reports and Analysis Capabilities

Cost Explorer Reports and Features

Default Reports | Report Type | Purpose | |-------------|---------| | Monthly costs by service | See which services drive spending | | Monthly costs by linked account | Track costs across accounts in Organizations | | Daily costs | Identify spending anomalies | | Monthly EC2 running hours costs | Analyze compute usage patterns |

Key Features:

  • View costs and usage for last 12 months
  • Forecast costs up to 12 months ahead
  • Filter by service, region, tag, account, and more
  • Group costs by multiple dimensions
  • Save custom reports for reuse
  • Export data to CSV for external analysis
  • API access for programmatic analysis

Granularity Options:

  • Monthly (default, fastest)
  • Daily (more detail, larger datasets)
  • Hourly (requires hourly granularity enabled, additional cost)

Free Tier: Cost Explorer is free to use; API calls cost $0.01 per request

Rightsizing Recommendations

EC2 Rightsizing Recommendations

How It Works:

  • Analyzes 14 days of CloudWatch metrics (CPU, memory, network)
  • Identifies underutilized or idle EC2 instances
  • Recommends smaller instance types or termination
  • Shows estimated monthly savings

Recommendation Types: | Type | Criteria | Action | |------|----------|--------| | Modify | Low utilization (<40% CPU typical) | Resize to smaller instance | | Terminate | Very low/no utilization | Shut down instance |

Key Metrics Analyzed:

  • CPU utilization
  • Memory utilization (requires CloudWatch agent)
  • Network I/O
  • Disk I/O

Limitations:

  • EC2 instances only (not RDS, ECS, etc.)
  • 14-day minimum history required
  • Memory metrics require CloudWatch agent
  • Recommendations are suggestions, not automated

Best Practice: Review recommendations weekly and implement during maintenance windows

Reserved Instance Reports

RI Coverage and Utilization Reports

RI Coverage Report

  • Shows percentage of running instance hours covered by RIs
  • Identifies On-Demand usage that could be converted to RIs
  • Calculates potential savings from increased RI coverage
  • Filter by service, region, instance type

Coverage Calculation:

RI Coverage = Reserved Instance Hours / Total Running Hours x 100%

Example:
- Total running hours: 10,000
- RI covered hours: 7,500
- Coverage: 75%
- Opportunity: 25% could be covered by RIs

RI Utilization Report

  • Shows percentage of purchased RI hours actually used
  • Identifies unused RI capacity (wasted money)
  • Helps right-size future RI purchases

Utilization Calculation:

RI Utilization = Used RI Hours / Purchased RI Hours x 100%

Example:
- Purchased RI hours: 10,000
- Actually used: 8,500
- Utilization: 85%
- Waste: 15% of RI cost unused

Target Benchmarks:

  • Coverage: Aim for 70-80% for predictable workloads
  • Utilization: Aim for 95%+ to minimize waste

Savings Plans Reports

Savings Plans Coverage and Utilization

Savings Plans Coverage Report

  • Shows percentage of compute spend covered by Savings Plans
  • Identifies On-Demand spend that could benefit from Savings Plans
  • Includes EC2, Lambda, and Fargate usage

Savings Plans Utilization Report

  • Shows how much of your Savings Plans commitment is being used
  • Identifies over-purchased or under-utilized Savings Plans
  • Helps optimize future purchases

Key Difference from RIs:

  • Savings Plans measure dollars committed vs. used
  • RIs measure instance hours reserved vs. used
  • Savings Plans apply automatically to best savings opportunity

Purchase Recommendations:

  • Cost Explorer provides Savings Plans purchase recommendations
  • Based on historical usage patterns
  • Shows estimated savings for different commitment levels
  • Recommends optimal term (1-year vs 3-year) and payment option

AWS Budgets

AWS Budgets Types and Alerts

Budget Types | Budget Type | Purpose | Use Case | |-------------|---------|----------| | Cost Budget | Track dollar spend | "Alert if monthly spend exceeds $1000" | | Usage Budget | Track service usage | "Alert if EC2 hours exceed 1000" | | Reservation Budget | Track RI/SP coverage/utilization | "Alert if RI utilization drops below 80%" | | Savings Plans Budget | Track Savings Plans utilization | "Alert if SP utilization drops below 90%" |

Alert Thresholds

  • Actual cost/usage thresholds (when you've already spent)
  • Forecasted cost/usage thresholds (when you're predicted to spend)
  • Multiple thresholds per budget (e.g., 50%, 80%, 100%)

Notification Options:

  • Email (up to 10 recipients per alert)
  • Amazon SNS topics (for integration with other systems)
  • AWS Chatbot (Slack, Microsoft Teams)

Pricing:

  • First 2 budgets per month: FREE
  • Additional budgets: $0.02/day per budget ($0.62/month)
  • Budget actions and Budget Reports have additional costs

AWS Budget Actions

Automated Budget Actions

Available Actions | Action Type | Effect | Use Case | |-------------|--------|----------| | IAM Policy | Apply deny policy to users/roles | Prevent new resource creation | | SCP Policy | Apply deny policy at OU/account level | Organization-wide enforcement | | Stop EC2 Instances | Stop specific EC2 instances | Reduce compute costs | | Stop RDS Instances | Stop specific RDS instances | Reduce database costs |

Action Execution Options:

  • Run automatically when threshold breached
  • Require manual approval (workflow)

IAM Policy Action Example: Attach a deny policy that prevents:

  • Launching new EC2 instances
  • Creating new resources
  • Starting stopped instances

Best Practice: Start with manual approval, then automate once confident in thresholds

Important: Actions require IAM role with appropriate permissions

Cost Allocation Tags

Cost Allocation Tags

Tag Types | Type | Source | Activation | |------|--------|------------| | AWS-generated tags | Created by AWS (e.g., aws:createdBy) | Activate in Billing Console | | User-defined tags | Created by you | Must be activated for cost allocation |

Common Tagging Strategies | Tag Key | Example Values | Purpose | |---------|---------------|---------| | Environment | prod, dev, test, staging | Track costs by environment | | Project | project-alpha, website-v2 | Allocate to projects | | CostCenter | CC-001, engineering-team | Chargeback/showback | | Owner | john.doe, ops-team | Accountability | | Application | inventory-app, payment-service | Application costs |

Tag Activation Process:

  1. Create tags on resources (via console, CLI, or IaC)
  2. Go to Billing Console > Cost Allocation Tags
  3. Select tags to activate
  4. Wait up to 24 hours for activation
  5. Tags appear in Cost Explorer after activation

Key Points:

  • Tags must be activated before they appear in Cost Explorer
  • Historical data NOT retroactively tagged
  • Up to 500 user-defined tags per account
  • Tags are case-sensitive

Cost-Benefit Analysis

Cost Management Tools Comparison

FeatureCost ExplorerAWS BudgetsCost and Usage Reports
Primary PurposeAnalyze and visualize costsSet thresholds and alertsDetailed billing data export
Historical Data12 monthsN/A (forward-looking)Unlimited (S3 storage)
ForecastingUp to 12 monthsForecasted alerts onlyNo
AlertsNoYes (email, SNS, Chatbot)No (use Budgets)
Automated ActionsNoYes (IAM, SCP, Stop instances)No
CostFree (API: $0.01/request)2 free, then $0.62/monthFree (plus S3 storage)
Best ForAnalysis and planningGovernance and controlDetailed audit and chargeback

When to Use Each Tool

Decision Framework

Cost Management Decision Guide

ScenarioUse Cost ExplorerUse AWS BudgetsUse CUR
Analyze last month spendingYes - view reportsNoFor detailed line items
Predict next quarter costsYes - forecastingNoNo
Alert when spend exceeds $500NoYes - cost budgetNo
Stop instances at budget limitNoYes - budget actionsNo
Track costs by projectYes - with tagsYes - with tagsYes - detailed breakdown
Identify underused EC2Yes - rightsizingNoNo
RI purchase recommendationYes - RI reportsNoNo
Detailed hourly billingLimitedNoYes - full detail
Chargeback to departmentsYes - basicNoYes - detailed

CLI Commands

SHCost Explorer CLI - View Costs
# Get cost and usage for last month
aws ce get-cost-and-usage \
  --time-period Start=2024-01-01,End=2024-01-31 \
  --granularity MONTHLY \
  --metrics "BlendedCost" "UnblendedCost" \
  --group-by Type=DIMENSION,Key=SERVICE

# Get cost forecast for next 3 months
aws ce get-cost-forecast \
  --time-period Start=2024-02-01,End=2024-04-30 \
  --granularity MONTHLY \
  --metric UNBLENDED_COST

# Get costs filtered by tag
aws ce get-cost-and-usage \
  --time-period Start=2024-01-01,End=2024-01-31 \
  --granularity MONTHLY \
  --metrics "BlendedCost" \
  --filter '{"Tags":{"Key":"Environment","Values":["production"]}}'
SHCost Explorer CLI - Rightsizing Recommendations
# Get EC2 rightsizing recommendations
aws ce get-rightsizing-recommendation \
  --service AmazonEC2 \
  --configuration '{"RecommendationTarget":"SAME_INSTANCE_FAMILY","BenefitsConsidered":true}'

# Get recommendations with estimated savings
aws ce get-rightsizing-recommendation \
  --service AmazonEC2 \
  --page-size 100

# Filter recommendations by tag
aws ce get-rightsizing-recommendation \
  --service AmazonEC2 \
  --filter '{"Tags":{"Key":"Environment","Values":["development"]}}'
SHCost Explorer CLI - RI and Savings Plans Reports
# Get RI coverage
aws ce get-reservation-coverage \
  --time-period Start=2024-01-01,End=2024-01-31 \
  --granularity MONTHLY

# Get RI utilization
aws ce get-reservation-utilization \
  --time-period Start=2024-01-01,End=2024-01-31 \
  --granularity MONTHLY

# Get Savings Plans coverage
aws ce get-savings-plans-coverage \
  --time-period Start=2024-01-01,End=2024-01-31

# Get Savings Plans utilization
aws ce get-savings-plans-utilization \
  --time-period Start=2024-01-01,End=2024-01-31

# Get Savings Plans purchase recommendations
aws ce get-savings-plans-purchase-recommendation \
  --savings-plans-type COMPUTE_SP \
  --term-in-years ONE_YEAR \
  --payment-option NO_UPFRONT \
  --lookback-period-in-days SIXTY_DAYS
SHAWS Budgets CLI - Create and Manage Budgets
# Create a cost budget with alert
aws budgets create-budget \
  --account-id 123456789012 \
  --budget '{
    "BudgetName": "Monthly-Cost-Budget",
    "BudgetLimit": {"Amount": "1000", "Unit": "USD"},
    "BudgetType": "COST",
    "TimeUnit": "MONTHLY",
    "CostFilters": {}
  }' \
  --notifications-with-subscribers '[{
    "Notification": {
      "NotificationType": "ACTUAL",
      "ComparisonOperator": "GREATER_THAN",
      "Threshold": 80,
      "ThresholdType": "PERCENTAGE"
    },
    "Subscribers": [{
      "SubscriptionType": "EMAIL",
      "Address": "alerts@company.com"
    }]
  }]'

# Create budget with SNS notification
aws budgets create-budget \
  --account-id 123456789012 \
  --budget '{
    "BudgetName": "EC2-Usage-Budget",
    "BudgetLimit": {"Amount": "1000", "Unit": "HOURS"},
    "BudgetType": "USAGE",
    "TimeUnit": "MONTHLY",
    "UsageType": "EC2:Hours"
  }' \
  --notifications-with-subscribers '[{
    "Notification": {
      "NotificationType": "FORECASTED",
      "ComparisonOperator": "GREATER_THAN",
      "Threshold": 100,
      "ThresholdType": "PERCENTAGE"
    },
    "Subscribers": [{
      "SubscriptionType": "SNS",
      "Address": "arn:aws:sns:us-east-1:123456789012:budget-alerts"
    }]
  }]'

# List all budgets
aws budgets describe-budgets --account-id 123456789012

# Delete a budget
aws budgets delete-budget \
  --account-id 123456789012 \
  --budget-name "Monthly-Cost-Budget"
SHCost Allocation Tags CLI
# Tag an EC2 instance for cost allocation
aws ec2 create-tags \
  --resources i-1234567890abcdef0 \
  --tags Key=Environment,Value=production Key=Project,Value=web-app

# Tag multiple resources
aws ec2 create-tags \
  --resources i-111111 i-222222 vol-333333 \
  --tags Key=CostCenter,Value=CC-001

# Get resources by tag
aws resourcegroupstaggingapi get-resources \
  --tag-filters Key=Environment,Values=production

# List activated cost allocation tags (via Cost Explorer)
# Note: Tag activation is done in Billing Console, not CLI
aws ce list-cost-allocation-tags \
  --status Active

Real-World Cost Scenarios

Scenario 1: Startup Cost Governance

Setup: Startup wants to avoid surprise bills

  • Monthly budget: $5,000
  • Multiple development teams
  • No prior AWS experience

Solution:

1. Enable Cost Explorer (free)
2. Create cost budget: $5,000/month
3. Set alert thresholds:
   - 50% actual: informational
   - 80% actual: warning
   - 100% forecasted: critical
4. Add budget action: Apply IAM deny policy at 90%
5. Implement tagging: Team, Environment, Project
6. Weekly Cost Explorer review meetings

Result: Proactive cost control and team accountability

Scenario 2: Enterprise Chargeback

Setup: Large enterprise needs department chargeback

  • 50+ AWS accounts in Organizations
  • Finance requires monthly cost reports by department
  • Need to track project-level costs

Solution:

1. Implement mandatory tagging policy:
   - Department (required)
   - Project (required)
   - Owner (required)
2. Create SCPs to enforce tag compliance
3. Activate tags for cost allocation
4. Use Cost Explorer with tag grouping
5. Export Cost and Usage Reports to S3
6. Build BI dashboards for finance team

Result: Accurate cost attribution and department accountability

Scenario 3: RI Optimization

Setup: Company with 70% On-Demand EC2 spend

  • Stable production workloads
  • Underutilized existing RIs
  • No visibility into RI performance

Solution:

1. Review RI Utilization Report in Cost Explorer
   - Current utilization: 65% (waste identified)
2. Review RI Coverage Report
   - Current coverage: 30% (opportunity identified)
3. Get RI/Savings Plans recommendations
4. Purchase Savings Plans for additional coverage
5. Set RI Utilization Budget: alert if <80%
6. Monthly review of coverage and utilization

Result:

  • RI utilization improved from 65% to 92%
  • Coverage increased from 30% to 75%
  • 40% reduction in compute costs

Common Pitfalls

Not Activating Cost Allocation Tags

The Mistake: Creating tags on resources but forgetting to activate them in the Billing Console.

The Impact: Tags don't appear in Cost Explorer, making cost tracking by project/team impossible.

The Fix: After creating tags, go to Billing Console > Cost Allocation Tags > Select tags > Activate. Wait 24 hours for data to appear. Note: Historical data will NOT be retroactively tagged.

Setting Only Actual Cost Alerts (Not Forecasted)

The Mistake: Only setting alerts for actual spend, missing forecasted overspend.

The Impact: By the time actual spend triggers the alert, it's too late to prevent the overage.

The Fix: Always set both ACTUAL and FORECASTED thresholds. Set forecasted alert at 100% and actual alerts at 50%, 80%, 100%. This gives early warning before costs are incurred.

Over-Relying on Rightsizing Recommendations Without Context

The Mistake: Blindly implementing all rightsizing recommendations without understanding workload patterns.

The Impact: Downsizing instances that need burst capacity causes performance issues.

The Fix: Review recommendations with application owners. Check if workloads have periodic spikes (monthly batch jobs, end-of-quarter processing). Consider rightsizing for average usage PLUS headroom, not just minimum observed usage.

Purchasing RIs Based on Coverage Alone

The Mistake: Purchasing Reserved Instances to increase coverage without checking utilization first.

The Impact: Buying more RIs when existing ones are underutilized, wasting money on unused capacity.

The Fix: Always check RI Utilization Report BEFORE purchasing more RIs. Target 95%+ utilization on existing RIs first. If utilization is low, investigate why (workload changes, right-sizing opportunities) before buying more.

Not Using Budget Actions for Automated Governance

The Mistake: Setting budget alerts but relying solely on manual intervention to control costs.

The Impact: Alert fatigue or missed alerts lead to budget overruns without action.

The Fix: Implement Budget Actions to automatically apply IAM deny policies or stop non-critical resources when thresholds are breached. Start with manual approval workflow, then automate once confident in thresholds. Ensure development/test environments have automated cost controls.

Exam Scenarios

Scenario-Based Questions

ScenarioBest SolutionKey Rationale
Company wants to analyze last 6 months of spending by serviceCost Explorer with service groupingCost Explorer provides 12 months historical data with filtering
Alert finance team when monthly spend exceeds budgetAWS Budgets with cost budgetBudgets provide threshold alerts with email/SNS
Identify EC2 instances that should be resizedCost Explorer Rightsizing RecommendationsAnalyzes CloudWatch metrics to recommend optimal sizes
Automatically stop dev instances when budget exceededAWS Budgets with Budget ActionsBudget Actions can stop EC2/RDS instances
Track costs by project across multiple accountsCost allocation tags + Cost ExplorerTags enable cost tracking by any dimension
Forecast next quarter AWS costs for budget planningCost Explorer cost forecastForecasts up to 12 months based on historical patterns
Measure RI utilization to optimize purchasesCost Explorer RI Utilization ReportShows percentage of purchased RI hours used
Prevent any resource creation when over budgetAWS Budgets with IAM/SCP actionDeny policies block new resource creation

Cost Optimization Question Patterns

  1. "Analyze spending" + "by service/account/region" = Cost Explorer with grouping
  2. "Alert when exceeds" = AWS Budgets with cost budget
  3. "Forecast costs" = Cost Explorer forecasting
  4. "Track by project/team/department" = Cost allocation tags
  5. "Right-size instances" = Cost Explorer Rightsizing Recommendations
  6. "RI performance" = RI Coverage and Utilization Reports
  7. "Prevent overspending automatically" = Budget Actions
  8. "Savings Plans recommendations" = Cost Explorer Savings Plans reports

Test Your Knowledge

Q

A company wants to track AWS costs by department for chargeback purposes. They have already created tags on all resources. What additional step is required before costs appear in Cost Explorer by department?

AEnable Cost Explorer in the Billing Console
BCreate an AWS Budget for each department
CActivate the tags as cost allocation tags in the Billing Console
DEnable detailed billing reports in S3
Q

A Solutions Architect needs to automatically prevent new EC2 instances from being launched when monthly costs exceed $10,000. Which solution meets this requirement?

ACreate a Cost Explorer alert with Lambda action
BCreate an AWS Budget with a Budget Action that applies an IAM deny policy
CCreate a CloudWatch alarm that triggers an SNS notification
DCreate an AWS Config rule to check instance costs
Q

A company's Reserved Instance utilization is at 60%, but coverage is only 25%. What should they do FIRST before purchasing additional RIs?

APurchase more RIs to increase coverage to 75%
BInvestigate why existing RI utilization is low before buying more
CConvert existing RIs to Convertible RIs
DCancel existing RIs and buy Savings Plans instead
Q

A startup wants to forecast their AWS costs for the next 6 months for budget planning. They have 3 months of usage history. Which service provides this capability?

AAWS Budgets forecasted alerts
BCost Explorer cost forecast
CAWS Pricing Calculator
DAWS Trusted Advisor

Quick Reference

Cost Explorer Key Features

FeaturePurposeData Range
Cost & Usage ReportsAnalyze spending patterns12 months historical
Cost ForecastPredict future costsUp to 12 months ahead
RightsizingIdentify oversized EC214 days minimum
RI CoverageTrack RI coverage percentageCustomizable
RI UtilizationTrack RI usage percentageCustomizable
Savings Plans ReportsCoverage and utilizationCustomizable

AWS Budgets Key Features

Budget TypeThreshold TypesActions Available
Cost BudgetActual, ForecastedIAM policy, SCP, Stop EC2/RDS
Usage BudgetActual, ForecastedIAM policy, SCP, Stop EC2/RDS
RI BudgetCoverage, UtilizationIAM policy, SCP
Savings Plans BudgetCoverage, UtilizationIAM policy, SCP

Cost Allocation Tag Best Practices

Tag KeyDescriptionExample Values
EnvironmentDeployment environmentprod, dev, test, staging
ProjectProject or initiative nameproject-x, migration-2024
CostCenterFinancial cost centerCC-001, engineering
OwnerResponsible team or personplatform-team, john.doe
ApplicationApplication nameinventory-api, web-frontend

CLI Quick Reference

# Cost Analysis
aws ce get-cost-and-usage \
  --time-period Start=YYYY-MM-DD,End=YYYY-MM-DD \
  --granularity MONTHLY \
  --metrics BlendedCost

# Cost Forecast
aws ce get-cost-forecast \
  --time-period Start=YYYY-MM-DD,End=YYYY-MM-DD \
  --granularity MONTHLY \
  --metric UNBLENDED_COST

# Rightsizing Recommendations
aws ce get-rightsizing-recommendation --service AmazonEC2

# RI Reports
aws ce get-reservation-coverage --time-period Start=YYYY-MM-DD,End=YYYY-MM-DD
aws ce get-reservation-utilization --time-period Start=YYYY-MM-DD,End=YYYY-MM-DD

# Savings Plans Reports
aws ce get-savings-plans-coverage --time-period Start=YYYY-MM-DD,End=YYYY-MM-DD
aws ce get-savings-plans-utilization --time-period Start=YYYY-MM-DD,End=YYYY-MM-DD

# Create Budget with Alert
aws budgets create-budget \
  --account-id ACCOUNT_ID \
  --budget file://budget.json \
  --notifications-with-subscribers file://notifications.json

# List Budgets
aws budgets describe-budgets --account-id ACCOUNT_ID

Decision Quick Guide

QuestionAnswer
Need to analyze historical costs?Cost Explorer (12 months)
Need to forecast future costs?Cost Explorer (up to 12 months)
Need alerts when budget exceeded?AWS Budgets
Need to automatically stop resources?Budget Actions
Need to track costs by project?Cost allocation tags
Need to identify oversized EC2?Rightsizing Recommendations
Need to check RI performance?RI Coverage/Utilization Reports
Need detailed billing line items?Cost and Usage Reports

Further Reading

Related services

Cost ExplorerBudgets