All guides
Practice now
D3 · Continuous Improvement for Existing Solutions

Cost optimization at scale: Compute Optimizer, RI/SP and Cost Explorer

For the SAP-C02, cost optimization is a continuous discipline, not a one-time event. The exam tests your ability to identify savings opportunities, choose between RIs and Savings Plans, and establish cost visibility across complex organizations.

Icon-Architecture/48/Arch_AWS-Cost-Explorer_48

The 4 pillars of cost optimization on AWS

📏

1. Right-sizing

Use the correct instance type and size. Bigger isn't always better — many instances are over-provisioned with average CPU under 20%.

⚡

2. Increase elasticity

Scale to zero or the minimum when there's no demand. , , Aurora Serverless, ECS on . No 24/7 idle instances for variable workloads.

💰

3. Correct pricing model

On-Demand for unpredictable workloads, Reserved/Savings Plans for stable 24/7 workloads, Spot for interruption-tolerant ones. The wrong model can multiply your costs.

🗄️

4. Optimize storage

S3 Intelligent-Tiering for unpredictable access, lifecycle policies for cold data, removing orphaned EBS snapshots, gp3 vs gp2 (cheaper and better).

Icon-Architecture/48/Arch_AWS-Compute-Optimizer_48

AWS Compute Optimizer — ML-based rightsizing

Compute Optimizer uses Machine Learning to analyze resource utilization history and recommend the optimal type. It analyzes 14 days of metrics by default (up to 3 months with Compute Optimizer enhanced).

Resources analyzed

EC2 InstancesRecommends an instance type based on CPU, memory, network, and disk. Detects over- and under-provisioned instances.
Auto Scaling GroupsRecommends instance type for the ASG's Launch Template/Config.
EBS VolumesIdentifies volumes with underused IOPS (e.g., an io1 volume that could be a cheaper gp3).
Lambda FunctionsRecommends optimal memory (which impacts CPU and price) based on historical invocations.
ECS Services on FargateRecommends CPU/memory for Tasks to optimize cost without degrading performance.

Recommendation levels

Over-provisionedInstance is larger than needed. You can downsize. Potential savings.
Under-provisionedInstance is too small. Degraded performance. You should upsize.
OptimizedThe current type is right for the workload.
None (insufficient data)Not enough metric history to recommend anything.

Compute Optimizer across Organizations

Enable it at the Management Account level to get recommendations for all member accounts in a single dashboard. It generates a cross-account report of rightsizing opportunities.

Icon-Architecture/48/Arch_AWS-Cost-Explorer_48

Cost Explorer — advanced cost analysis

Cost Explorer lets you visualize and analyze historical costs (up to 13 months) and forecasts (12 months ahead). For the SAP-C02, the focus is on advanced analysis features and RI/SP recommendations.

Key filters and dimensions

  • By Account: see spending per member account in the org
  • By Service: how much the org spends on EC2, RDS, S3, etc.
  • By Tag: see costs per project, team, environment
  • By Region: compare costs across regions
  • By Purchase type: On-Demand vs Reserved vs Spot
  • By Instance Type: which instance families dominate spend

RI and SP recommendations

  • Analyzes On-Demand usage over the last 7/30/60 days
  • Calculates the ROI of buying RIs or Savings Plans based on your current pattern
  • Shows the breakeven point (when you recover the investment)
  • Savings Plans Coverage: what % of your eligible On-Demand usage is covered by SP
  • RI Utilization: what % of your RIs are actually being used

Cost Explorer API

The Cost Explorer API lets you automate cost reports, integrate with BI dashboards (Quick Sight), and generate custom cost alerts programmatically. Cost: $0.01 per request.

Icon-Architecture/48/Arch_AWS-Cost-Explorer_48

Reserved Instances vs Savings Plans — purchase strategy

TypeFlexibilityDiscountBest strategy
Standard RILow — family, OS, tenancy fixed within region/AZUp to 72% (EC2)Production with a stable instance type for 3+ years
Convertible RIMedium — can change family, OS, tenancyUp to 54%Production where you might move to newer generations
EC2 Instance Savings PlanHigh — only family and instance within regionUp to 72%Equivalent to Standard RI but simpler to manage
Compute Savings PlanVery high — any EC2 + Fargate + LambdaUp to 66%Organizations with a mix of services or that shift between types
SageMaker Savings PlanHigh — ML workloads on SageMakerUp to 64%Organizations with ML training/inference at scale

Recommended purchase strategy for the exam

Step 1: Baseline with Compute Savings PlansCover 80% of your stable usage with Compute SP (maximum flexibility). If the instance type changes, the SP still applies.
Step 2: Refine with EC2 Instance Savings Plans or RIsFor the most stable, predictable workloads, apply EC2 Instance SP or Standard RI for a bigger discount.
Step 3: Spot for the restInterruption-tolerant workloads (batch, CI/CD, ML training) — use Spot to round out the savings.

Tagging Strategy — cost visibility across Organizations

Cost Allocation Tags

  • Activate in the Billing Dashboard → Cost Allocation Tags
  • Two types: AWS-generated (aws:createdBy, aws:cloudformation:stackname) and User-defined
  • Only activated tags show up in Cost Explorer and billing reports
  • Example taxonomy: Project, Environment, Team, CostCenter, Owner
  • Required tags via : use the "required-tags" rule to detect untagged resources

— centralized cost management

  • Consolidated billing: one invoice for the whole org, broken down by account
  • RIs and SPs are automatically shared across org accounts (scale benefit)
  • Consolidated Cost Explorer: view costs from every account in one place
  • Linked account managers: each team can view its own costs via IAM
  • Shared Service Quotas: some quotas are per-account, others are per-org
Icon-Architecture/48/Arch_AWS-Budgets_48

AWS Budgets and Cost Anomaly Detection

AWS Budgets

Define spending thresholds and get alerted when actual or forecasted spend exceeds the budget. Four budget types:

Cost BudgetAlerts when spend exceeds $X in the period.
Usage BudgetAlerts when a service's usage exceeds N units (EC2 hours, S3 GB).
RI/SP Coverage BudgetAlerts when RI/SP coverage drops below X%.
RI/SP Utilization BudgetAlerts when RI/SP utilization drops below X%.

Cost Anomaly Detection

Uses ML to detect unusual spending without needing static thresholds. Detects anomalies based on your historical spending pattern.

  • Configured per monitor (account, service, tag, linked account)
  • Alerts via → email, Slack, PagerDuty
  • Root cause: identifies which service/region/account caused the anomaly
  • Useful for: catching a misconfigured EC2 that scales out of control, abandoned resources
  • Complements AWS Budgets — Anomaly Detection for the unexpected, Budgets for known thresholds
Icon-Architecture/48/Arch_AWS-Trusted-Advisor_48

— automated optimization

CategoryAvailable checks (Business+)Typical action
Cost OptimizationUnused EC2, unattached EBS, unassociated elastic IPs, underutilized RIs, S3 without lifecycleTerminate/delete idle resources, apply lifecycle, buy RIs
PerformanceHigh-utilization EC2, high-throughput EBS, CloudFront with low cache hits, RDS with high connection countsUpgrade instance type, tune caching
SecuritySecurity groups with unrestricted access, root without MFA, IAM without a password policy, public S3Apply security best practices
Fault ToleranceRDS without Multi-AZ, EBS without recent snapshots, single-AZ ASG, Route 53 without health checksEnable Multi-AZ, create backups
Service LimitsResources approaching account limitsRequest a limit increase from AWS

Trusted Advisor with Organizations and EventBridge

Trusted Advisor Priority with Organizations aggregates recommendations from every member account into a central dashboard. EventBridge receives events when a check's status changes (green/yellow/red), letting you automate remediation with Lambda.

Icon-Architecture/48/Arch_AWS-Cost-Explorer_48

Common exam pitfalls

Pitfall: "Convertible RIs offer the same discount as Standard RIs"

Reality: FALSE. Standard RIs offer up to 72% off. Convertible RIs offer up to 54% — the smaller discount is the price of flexibility to change family/OS.

Pitfall: "Compute Optimizer analyzes costs like Cost Explorer"

Reality: Different purposes. Compute Optimizer analyzes performance metrics to recommend the optimal resource type. Cost Explorer analyzes historical costs and forecasts. For rightsizing use both: Compute Optimizer for the right type, Cost Explorer to validate the cost impact.

Pitfall: "AWS tags (aws:createdBy) are automatically available in Cost Explorer"

Reality: FALSE. Tags (both AWS-generated and user-defined) must be explicitly activated as Cost Allocation Tags in the Billing Dashboard. Without activating them, they don't appear in Cost Explorer or billing reports.

Did you get this topic?

Test what you just learned

A company has 80 AWS accounts in Organizations. The CFO wants to know how much each dev team spends on EC2 and to automatically detect when a team exceeds its assigned budget. They also want to be alerted if any account shows unusual spending not explained by the historical pattern. Which combination of services satisfies ALL the requirements?

Ready to test "Cost Optimization: Compute Optimizer, RI/SP and Cost Explorer"?

Put what you learned to the test with original SAP-C02 exam questions.

Start SAP-C02 mock exam

Unlimited mock exams with the Pro plan

Log in to track your progress.