Chapter 8 of 9
Cost-Optimized Architectures: Pricing Models, Right-Sizing, and Cost Tools
The exam doesn’t just want you to build great systems—it wants them to be affordable. This module shows how to read between the lines for cost signals, then apply AWS pricing models, right‑sizing, and cost management tools to land the most economical design.
Reading Cost Signals in Exam Scenarios
Spotting Cost Signals
Exam questions rarely say "optimize cost" directly. Look for hints in the wording: usage patterns, data patterns, and constraints that imply a cost angle.
Key Phrases to Notice
Watch for phrases like spiky traffic, predictable workload, batch jobs that can be interrupted, infrequent access, archival, cross-region, or large data transfer.
Commitment and Constraints
Long-running, steady production workloads hint at commitments (Savings Plans/RIs). Temporary or experimental workloads hint at On-Demand or Spot.
4-Point Cost Checklist
For each question, ask: 1) compute: steady/spiky/batch? 2) data: hot/warm/cold? 3) uptime: mission-critical or best-effort? 4) time horizon: temporary or multi-year?
AWS Pricing Fundamentals and Main Cost Levers
Compute Pricing Models
Know the big four: On-Demand (flexible), Savings Plans (commit $/hr for discounts), Reserved Instances (still key for RDS/Redshift etc.), and Spot (cheap but interruptible).
Savings Plans vs RIs
Today, Savings Plans are preferred for EC2 compute flexibility, while RIs remain important for services like RDS, ElastiCache, OpenSearch, and Redshift.
Storage Cost Basics
S3 charges for GB, requests, and data out. Different S3 classes trade cost for access speed and availability. EBS charges for size and sometimes IOPS/throughput.
Data Transfer as a Cost Lever
Data into AWS is usually free; cross-AZ, cross-region, and data out to the internet cost money. Use CloudFront and smart region/AZ design to reduce these costs.
Example: Choosing the Right Compute Pricing Model
Workload A: Steady and Long-Term
Payroll app, 24/7, steady for 3+ years. Use Compute or EC2 Instance Savings Plans for EC2, and RDS Reserved Instances for the DB. Steady + long-term = commit.
Workload B: Batch and Interruptible
Nightly video rendering, jobs can restart. Use EC2 Spot Instances in Auto Scaling. Optionally mix some On-Demand as a safety baseline.
Workload C: Unpredictable Startup App
New mobile backend with unknown traffic. Start with On-Demand or serverless (Lambda + API Gateway). Once usage stabilizes, buy Savings Plans.
Pattern to Remember
Steady+long-term → Savings Plans/RIs. Interruptible → Spot. Unknown → On-Demand or serverless first, then commit after you observe usage.
Right-Sizing: Matching Resources to Real Usage
What is Right-Sizing?
Right-sizing is reducing or changing resources so they match real usage, instead of leaving big, underused instances and volumes running.
Right-Sizing Compute
Downsize instance sizes, switch families (c for CPU, r/x for memory, i for I/O), or use burstable instances when CPU is usually low with occasional spikes.
Right-Sizing Databases
For RDS, pick the smallest instance that meets needs and use Multi-AZ only when required. For DynamoDB, choose on-demand or provisioned with auto scaling wisely.
Right-Sizing Storage
Use gp3 EBS for better price/perf, and move cold data in S3 to cheaper storage classes like Standard-IA or Glacier. Low utilization hints at right-sizing.
Thought Exercise: Right-Sizing an Architecture
Imagine an exam scenario:
- A web application runs on 4 x m5.large instances in one Auto Scaling group.
- Average CPU is 12%, memory is 25%.
- Traffic is higher during business hours (9am–6pm) and low at night.
- The app is stateless; sessions are stored in DynamoDB.
Your task
- List two specific right-sizing changes that would reduce cost while keeping availability.
- For each change, note why it reduces cost.
Pause and think, then compare with the sample ideas below.
Sample ideas (check yourself)
- Change instance type to t3.medium or t4g.medium and adjust Auto Scaling. Burstable instances are cheaper and CPU is usually low.
- Reduce minimum instance count at night using scheduled scaling (fewer instances when traffic is low).
- Consider Compute Savings Plans for the baseline capacity if this pattern is stable.
If your ideas were similar, you are correctly applying right-sizing principles.
AWS Cost Management Tools: Cost Explorer, Budgets, and Cost Anomaly Detection
Cost Explorer
Use Cost Explorer to visualize historical and forecasted costs, and break them down by service, account, region, or tag. It answers "where is the money going?"
AWS Budgets
AWS Budgets lets you set cost or usage budgets and get alerts via email or SNS when you approach or exceed thresholds. It is proactive cost control.
Cost Anomaly Detection
Cost Anomaly Detection uses ML to spot unusual cost spikes per service or account and alert you automatically, useful for catching misconfigurations.
Cost and Usage Report (CUR)
CUR delivers very detailed billing records to S3. Combine it with Athena or BI tools for deep analysis beyond what Cost Explorer provides.
Tagging, Cost Allocation, and Designing Cost-Aware Solutions
Why Tagging Matters for Cost
Tags like Environment, Application, and Owner allow you to slice costs by team or project. Activate them as cost allocation tags in the Billing console.
Cost Allocation with Tags
Once tags are active, Cost Explorer and CUR can show costs per tag value, answering questions like "What does Team X spend per month?"
Cost-Aware Architecture Ingredients
A cost-aware design combines right-sized resources, the right pricing model, and cost tools (Budgets, Cost Explorer, tagging) for visibility and control.
Organizations and Consolidated Billing
With AWS Organizations, you can centralize billing, share Savings Plans/RIs across accounts, and still allocate cost using tags and account structure.
Check Understanding: Pricing Models and Tools
Answer this exam-style question to test your understanding.
A company runs a steady 24/7 analytics workload on EC2 that will continue for at least 2 years. They want to minimize cost but keep flexibility to change instance families and regions in the future. Which option is MOST appropriate?
- Purchase 2-year Standard Reserved Instances for specific EC2 instance types in one region
- Use only On-Demand Instances and set an AWS Budget to alert on high spend
- Purchase 2-year Compute Savings Plans for a committed $/hour amount
- Run the workload entirely on Spot Instances in an Auto Scaling group
Show Answer
Answer: C) Purchase 2-year Compute Savings Plans for a committed $/hour amount
Compute Savings Plans provide discounts for a 1- or 3-year $/hour commitment while allowing flexibility across instance families, sizes, and regions for EC2, as well as Fargate and Lambda. Standard RIs are less flexible, On-Demand is more expensive, and Spot is not appropriate for a steady, critical 24/7 analytics workload.
Review Key Cost Optimization Terms
Flip through these cards to reinforce the main concepts.
- Right-sizing
- Adjusting resource types and sizes (compute, storage, databases) so they closely match actual usage, reducing waste while still meeting performance and availability requirements.
- Savings Plans
- A flexible discount model where you commit to a consistent $/hour of compute usage for 1 or 3 years in exchange for lower prices on EC2, Fargate, and Lambda (Compute) or specific EC2 families (EC2 Instance).
- Spot Instances
- EC2 capacity offered at deep discounts using spare AWS capacity. Instances can be interrupted, so they are best for fault-tolerant, flexible workloads like batch jobs and stateless processing.
- AWS Cost Explorer
- A tool to visualize and analyze AWS spending over time, break down costs by service, account, region, and tags, and forecast future spending.
- AWS Budgets
- A service that lets you set custom cost or usage budgets and receive alerts when your actual or forecasted usage exceeds thresholds.
- Cost Anomaly Detection
- An AWS service that uses machine learning to automatically detect unusual cost spikes and send alerts, helping you catch unexpected spending quickly.
- Cost Allocation Tags
- User-defined or AWS-generated tags that, once activated in the Billing console, allow you to categorize and allocate costs in Cost Explorer and the Cost and Usage Report.
Key Terms
- AWS Budgets
- A service that lets you define cost and usage budgets and receive alerts when spending exceeds defined thresholds.
- Right-sizing
- The process of matching AWS resource types and sizes to actual workload needs to avoid overprovisioning and reduce cost.
- Savings Plans
- Discount programs where you commit to a specific amount of compute spend per hour for 1 or 3 years, in exchange for lower prices on supported services.
- Spot Instances
- Discounted EC2 instances that use spare AWS capacity and can be interrupted by AWS, suitable for fault-tolerant and flexible workloads.
- AWS Cost Explorer
- An AWS tool for viewing, analyzing, and forecasting AWS costs and usage across services, accounts, and tags.
- Cost Allocation Tags
- Tags that, when activated in the Billing console, are used to categorize and allocate AWS costs in reports and dashboards.
- Compute Savings Plans
- A type of Savings Plan that provides the most flexibility, applying discounts to EC2 across regions and families, as well as Fargate and Lambda.
- Cost Anomaly Detection
- A service that uses machine learning to identify and alert on unexpected changes in AWS spending.
- Reserved Instances (RIs)
- A legacy-style discount model that provides lower prices for specific instance types and regions in exchange for a 1- or 3-year commitment, still widely used for services like RDS and Redshift.
- Cost and Usage Report (CUR)
- A detailed, customizable report that provides comprehensive billing data, delivered to S3 for analysis.