Reading35 min read·Module 4High exam weight

EC2 Pricing Models (On-Demand, Reserved, Spot)

Key concepts

  • On-Demand for unpredictable

  • Reserved Instances commitment

  • Standard vs Convertible RI

  • Spot for fault-tolerant

  • Capacity Reservations

Overview

Amazon EC2 offers multiple pricing models to optimize costs based on workload characteristics. Understanding when to use each model is a core competency tested on the SAA-C03 exam and essential for designing cost-optimized architectures.

Core Concept

EC2 pricing follows a simple pattern: More commitment = More savings. On-Demand has no commitment (highest cost), Reserved Instances offer 1-3 year commitments (up to 72% savings), and Spot Instances use spare capacity (up to 90% savings but can be interrupted).

Exam Tip

Exam questions often present scenarios requiring pricing model selection. Key signals: 'predictable/steady workload' → Reserved Instances, 'flexible/interruptible' → Spot, 'unpredictable/short-term' → On-Demand, 'need flexibility + savings' → Savings Plans.

Key Concepts

EC2 Pricing Model Comparison

EC2 Pricing Models Comparison
Figure 1: EC2 Pricing Models by Commitment and Savings

On-Demand Instances

Description: Pay by the second (Linux) or hour (Windows) with no commitment

Key Characteristics:

  • No upfront payment required
  • No long-term commitment
  • Pay only for what you use
  • Can launch/terminate anytime
  • Highest per-hour cost

Best Use Cases:

  • Short-term, spiky workloads
  • Development and testing
  • Applications with unpredictable usage
  • First-time workloads (before patterns known)
  • Workloads that cannot be interrupted

Pricing Example (m5.large, us-east-1):

  • ~$0.096/hour = ~$70/month = ~$840/year

Reserved Instances (RIs)

Description: Commit to 1 or 3-year term for significant discounts

Discount Levels: | Type | Term | Discount | |------|------|----------| | Standard RI | 1 year | Up to 40% | | Standard RI | 3 year | Up to 60% | | Convertible RI | 1 year | Up to 31% | | Convertible RI | 3 year | Up to 54% |

Payment Options:

  1. All Upfront: Largest discount, pay entire term upfront
  2. Partial Upfront: Medium discount, some upfront + monthly
  3. No Upfront: Smallest discount, monthly payments only

Best Use Cases:

  • Steady-state production workloads
  • Applications running 24/7
  • Predictable capacity requirements
  • Databases, core application servers

Pricing Example (m5.large, 3-year, All Upfront):

  • ~$0.038/hour effective = ~$28/month = ~$333/year (60% savings)

Spot Instances

Description: Bid on spare EC2 capacity at steep discounts

Key Characteristics:

  • Up to 90% discount vs On-Demand
  • Can be interrupted with 2-minute warning
  • Price fluctuates based on supply/demand
  • No long-term commitment

Interruption Handling:

  • 2-minute notification before termination
  • Can be stopped/hibernated (if configured)
  • Use Spot Instance interruption notice

Best Use Cases:

  • Batch processing jobs
  • Big data analytics
  • CI/CD and testing
  • Containerized workloads
  • Stateless web applications
  • Any fault-tolerant workload

Pricing Example (m5.large, us-east-1):

  • ~$0.03/hour = ~$22/month (70% savings)
  • Prices vary by instance type and AZ

Standard vs Convertible Reserved Instances

Standard vs Convertible Reserved Instances
Figure 2: Standard vs Convertible RI Comparison

Standard vs Convertible Reserved Instances

FeatureStandard RIConvertible RI
Maximum DiscountUp to 72%Up to 66%
Change Instance FamilyNoYes (exchange)
Change Instance SizeYes (modify)Yes (modify/exchange)
Change OS/TenancyNoYes (exchange)
Sell on RI MarketplaceYesNo
Region Scope ChangeNoYes (exchange)
Best ForKnown, stable workloadsEvolving workloads

RI Modification vs Exchange

Modify (Standard & Convertible)

  • Change Availability Zone within region
  • Change instance size within same family
  • Split or merge RIs
  • NO cost difference

Exchange (Convertible Only)

  • Change instance family (e.g., m5 → c5)
  • Change operating system
  • Change tenancy
  • Must result in equal or greater value
  • Cannot exchange to lower value

Example Exchange:

  • Have: 1x Convertible RI for c5.xlarge ($500 remaining)
  • Want: c6g.xlarge ($600 remaining)
  • Result: Pay $100 difference, get new RI

Capacity Reservations

On-Demand Capacity Reservations

Purpose: Guarantee EC2 capacity in a specific AZ

Key Features:

  • Reserve capacity without RI commitment
  • Pay On-Demand rate whether used or not
  • Can be created/cancelled anytime
  • Combine with RIs/Savings Plans for discounts

Use Cases:

  • Disaster recovery capacity
  • Guaranteed launch for critical workloads
  • Event-driven scaling needs
  • Compliance requirements

Pricing:

  • Same as On-Demand hourly rate
  • Pay even if capacity is unused
  • Apply RI/Savings Plan discounts when combined

Zonal vs Regional RIs

Zonal RIs (Assigned to Specific AZ)

  • Provides capacity reservation in that AZ
  • Discount applies only to that AZ
  • Guaranteed instance launch

Regional RIs (No AZ Specified)

  • Discount applies across all AZs in region
  • Size flexibility within instance family
  • NO capacity reservation
  • More flexibility, less guarantee

Best Practice:

  • Use Regional for flexibility
  • Use Zonal when capacity guarantee needed
  • Consider On-Demand Capacity Reservations + Regional RI for both

Spot Instance Deep Dive

Spot Instance Integration Patterns
Figure 3: Spot Instance Architecture Patterns

Spot Fleet & Spot Pools

Spot Fleet

  • Collection of Spot (and optionally On-Demand) instances
  • Define target capacity (instances or vCPUs)
  • Specify multiple instance types and AZs
  • Automatic replacement of interrupted instances

Allocation Strategies: | Strategy | Description | Best For | |----------|-------------|----------| | lowestPrice | Launches from lowest-price pool | Maximum cost savings | | capacityOptimized | Launches from pools with most capacity | Minimize interruptions | | diversified | Distributes across all pools | Balance of both |

Spot Pools:

  • Each instance type + AZ = one pool
  • Using multiple pools reduces interruption risk
  • capacityOptimized strategy is generally recommended
JSONSpot Fleet Request
{
  "SpotFleetRequestConfig": {
    "IamFleetRole": "arn:aws:iam::123456789012:role/spot-fleet-role",
    "TargetCapacity": 20,
    "SpotPrice": "0.05",
    "AllocationStrategy": "capacityOptimized",
    "LaunchSpecifications": [
      {
        "InstanceType": "m5.large",
        "ImageId": "ami-12345678",
        "SubnetId": "subnet-1a2b3c4d"
      },
      {
        "InstanceType": "m5.xlarge",
        "ImageId": "ami-12345678",
        "SubnetId": "subnet-1a2b3c4d"
      },
      {
        "InstanceType": "m4.large",
        "ImageId": "ami-12345678",
        "SubnetId": "subnet-1a2b3c4d"
      }
    ]
  }
}
SHAWS CLI - Pricing Model Commands
# Get current On-Demand pricing
aws pricing get-products \
  --service-code AmazonEC2 \
  --filters Type=TERM_MATCH,Field=instanceType,Value=m5.large

# Describe Reserved Instances
aws ec2 describe-reserved-instances \
  --filters Name=state,Values=active

# Get Spot price history
aws ec2 describe-spot-price-history \
  --instance-types m5.large \
  --product-descriptions "Linux/UNIX" \
  --start-time $(date -u -d "1 hour ago" +%Y-%m-%dT%H:%M:%S)

# Request Spot Fleet
aws ec2 request-spot-fleet \
  --spot-fleet-request-config file://spot-fleet-config.json

# Create Capacity Reservation
aws ec2 create-capacity-reservation \
  --instance-type m5.large \
  --instance-platform Linux/UNIX \
  --availability-zone us-east-1a \
  --instance-count 10

Pricing Model Decision Guide

EC2 Pricing Model Selection

Workload CharacteristicBest Pricing ModelDiscountNotes
24/7 production, known capacityStandard RI (3-year)Up to 72%Maximum savings for steady workloads
24/7 production, may change instance typeConvertible RIUp to 66%Flexibility to change configurations
Flexible compute needsCompute Savings PlansUp to 66%Most flexible commitment option
Batch processing, fault-tolerantSpot InstancesUp to 90%Highest savings, can be interrupted
Dev/test, unpredictable usageOn-Demand0%No commitment, maximum flexibility
Disaster recovery capacityOn-Demand Capacity Reservation0%Guarantees capacity when needed
Mixed workload fleetSpot Fleet + On-Demand baseVariableBalance cost and reliability

Best Practices

  1. Analyze Before Committing: Use Cost Explorer to understand usage patterns before purchasing RIs
  2. Use Savings Plans for Flexibility: When uncertain about instance types, prefer Compute Savings Plans
  3. Diversify Spot Pools: Use multiple instance types and AZs to minimize interruption risk
  4. Start with On-Demand: New workloads should start On-Demand until patterns are established
  5. Reserve Your Baseline: Use RIs for minimum steady-state, On-Demand/Spot for peaks
  6. Combine Strategies: Mix RIs/Savings Plans with Spot for optimal cost/reliability balance
  7. Monitor RI Utilization: Use Cost Explorer RI Coverage/Utilization reports

Common Exam Scenarios

Exam Scenario Decision Guide

ScenarioRecommended SolutionKey Reasoning
Production database running 24/7 for 3 yearsStandard RI (3-year, All Upfront)Maximum discount for steady, predictable workload
Web application with steady traffic, might migrate to GravitonConvertible RIFlexibility to change instance family
Batch data processing, can restart if interruptedSpot Instances with Spot FleetMaximum savings, workload is fault-tolerant
Development environment used 8 hours/dayOn-Demand or Scheduled Reserved InstancesNot running 24/7, RIs less beneficial
Need guaranteed capacity for DR in specific AZOn-Demand Capacity Reservation + Regional RICapacity guarantee plus discount
Uncertain workload, want savings without specific instance commitmentCompute Savings PlansFlexible commitment, automatic discount
Auto Scaling group with baseline + peaksRIs for baseline, On-Demand/Spot for scalingCost optimization with reliability
Short-term project (3 months)On-Demand onlyCommitment period exceeds project duration

Common Pitfalls

Unused Reserved Instances

RIs require payment regardless of usage. Purchasing RIs for workloads that might be decommissioned or migrated results in wasted spend. Always verify workload stability before committing.

Wrong RI Scope Selection

Zonal RIs provide capacity reservation but less flexibility. Regional RIs offer flexibility but no capacity guarantee. Choose based on whether capacity guarantee or flexibility is more important.

Spot Without Interruption Handling

Spot Instances WILL be interrupted. Applications must handle 2-minute termination notices gracefully. Without proper interruption handling, Spot can cause application failures.

Standard RI Lock-in

Standard RIs cannot change instance family. Purchasing Standard RIs before architectural decisions are finalized can lock you into suboptimal instance types.

Capacity Reservation Costs

On-Demand Capacity Reservations charge whether used or not. Reserving capacity "just in case" without using it wastes money at On-Demand rates.

Quick Reference

Pricing Comparison Summary

ModelDiscountCommitmentInterruptionBest For
On-Demand0%NoneNoFlexibility
Standard RIUp to 72%1-3 yearsNoSteady workloads
Convertible RIUp to 66%1-3 yearsNoEvolving workloads
SpotUp to 90%NoneYesFault-tolerant
Savings PlansUp to 66%1-3 yearsNoFlexible compute

Key CLI Commands

# Get RI recommendations
aws ce get-reservation-purchase-recommendation \
  --service Amazon Elastic Compute Cloud - Compute

# Describe Spot price history
aws ec2 describe-spot-price-history \
  --instance-types m5.large m5.xlarge \
  --product-descriptions "Linux/UNIX"

# Purchase Reserved Instance
aws ec2 purchase-reserved-instances-offering \
  --instance-count 1 \
  --reserved-instances-offering-id OFFERING_ID

# Create Capacity Reservation
aws ec2 create-capacity-reservation \
  --instance-type m5.large \
  --availability-zone us-east-1a \
  --instance-count 5

Test Your Knowledge

Q

A company runs a production database that must be available 24/7 for the next 3 years. The database runs on a db.r5.2xlarge RDS instance. Which pricing option provides the GREATEST cost savings?

AOn-Demand Instance
BStandard 1-year Reserved Instance, No Upfront
CStandard 3-year Reserved Instance, All Upfront
DConvertible 3-year Reserved Instance, Partial Upfront
Q

A data analytics team runs batch jobs that can be interrupted and restarted. The jobs typically complete within 2-4 hours and run daily. Which EC2 pricing strategy is MOST cost-effective?

AOn-Demand Instances for maximum flexibility
BSpot Instances with multiple instance types
C1-year Reserved Instances for the instance type used
DConvertible Reserved Instances
Q

A company has an application with a steady baseline of 10 instances but scales to 50 instances during peak hours (2 hours daily). Which combination is MOST cost-effective?

A50 On-Demand Instances
B50 Reserved Instances (3-year)
C10 Reserved Instances + 40 On-Demand for peaks
D10 Reserved Instances + 40 Spot Instances for peaks
Q

A company purchased Standard Reserved Instances for c5.xlarge but now wants to migrate to c6g.xlarge (Graviton). What should they do?

AModify the Reserved Instances to c6g.xlarge
BExchange the Reserved Instances for c6g.xlarge
CSell the RIs on the Reserved Instance Marketplace and purchase new ones
DContinue using c5.xlarge until RIs expire, then switch

Further Reading

Related services

EC2