DevOps Elastic Hayway
Document

SUBSCRIBE TO GET FULL ACCESS TO THE E-BOOKS FOR FREE 🎁SUBSCRIBE NOW

Professional Dropdown with Icon

SUBSCRIBE NOW TO GET FREE ACCESS TO EBOOKS

AWSLesson 10 / 478 min readUpdated September 11, 2026

EC2 Purchasing Options Explained: On-Demand, Savings Plans, Reserved, Spot, Dedicated and Capacity Blocks

The instance type decides how fast your EC2 workload runs; the purchasing option decides how much you pay for it, and the gap between options is huge: the same m7g.large can cost 100 % (On-Demand), about 60 % (Savings Plan) or 20–30 % (Spot) of the list price. This tutorial explains each option, the commitment and flexibility rules behind the discounts, and a strategy that most teams converge on: a baseline of Savings Plans, a bursting layer of On-Demand, and Spot for anything interruptible.

Prerequisites: familiarity with EC2 instance families and launch templates. Prices quoted are illustrative US East list prices; use the AWS Pricing Calculator for real numbers.

Overview table

OptionCommitmentTypical discount vs On-DemandFlexibilityRiskBest for
On-DemandNone; per-second billing (Linux)0 %TotalHighest priceDev/test, spiky or unknown workloads, first months of a project
Compute Savings Plan1 or 3 years, $/hour spendup to ~66 %Any instance family, size, region, OS, tenancy; also Fargate and LambdaPaying for unused commitmentSteady baseline across changing architectures
EC2 Instance Savings Plan1 or 3 years, $/hour spendup to ~72 %Locked to one family in one region; size/OS/tenancy freeFamily lock-inStable fleet on a known family (e.g. m7g in ca-central-1)
Reserved Instances (Standard)1 or 3 years, specific instanceup to ~72 %Size-flexible within family (Linux, default tenancy); can be sold on RI MarketplaceLeast flexibleLegacy; RDS/ElastiCache/OpenSearch still use RIs
Reserved Instances (Convertible)1 or 3 yearsup to ~66 %Exchangeable for other RIsExchange only, no saleMostly replaced by Savings Plans
Spot InstancesNoneup to 90 % (typically 60–80 %)Same instance types as On-Demand2-minute interruption notice when AWS needs capacityBatch, CI, big data, stateless web behind a load balancer, ML training with checkpoints
Dedicated InstancesNone (On-Demand or RI pricing + fee)negative (surcharge)Physically isolated hardware, AWS places themHigher priceCompliance requiring single-tenant hardware
Dedicated HostsOn-Demand hourly or 1/3-year reservationnegative, but license reuseYou control socket/core placementWhole-host billingBYOL Windows/SQL Server/Oracle per-socket licences
Capacity Blocks for ML1 day to 6 months, reserved in advancevariesGPU/Trainium clusters at a scheduled timePrepaidTraining runs needing hundreds of GPUs on a date
On-Demand Capacity ReservationsNone (pay On-Demand while reserved)0 % (but combinable with Savings Plans)Guarantees capacity in an AZPaying for idle reservationDisaster recovery, launch-day events

On-Demand: the reference price

You pay per second (minimum 60 s) for Linux and most Unix AMIs, per hour for some Windows and marketplace AMIs, with no commitment. Everything else is a discount off this price. Use it when you do not yet know the shape of your workload; after 2–3 months of Cost Explorer data you can decide what to commit.

# List On-Demand Linux prices for a type in a region (Pricing API lives in us-east-1)
aws pricing get-products --region us-east-1 --service-code AmazonEC2 
  --filters Type=TERM_MATCH,Field=instanceType,Value=m7g.large 
            Type=TERM_MATCH,Field=regionCode,Value=ca-central-1 
            Type=TERM_MATCH,Field=operatingSystem,Value=Linux 
            Type=TERM_MATCH,Field=tenancy,Value=Shared 
            Type=TERM_MATCH,Field=preInstalledSw,Value=NA 
            Type=TERM_MATCH,Field=capacitystatus,Value=Used 
  --query 'PriceList[0]' --output text | jq '.terms.OnDemand[].priceDimensions[].pricePerUnit'

Savings Plans: commit to spend, not to instances

A Savings Plan is a promise to spend, say, 10 USD per hour on compute for 1 or 3 years. Every hour, AWS applies the discounted rate to your usage up to that amount and bills the rest On-Demand. You never choose instances in advance, which is why Savings Plans have replaced Reserved Instances for EC2 in most organisations.

  • Compute Savings Plans apply to any EC2 instance anywhere, plus Fargate and Lambda. Maximum flexibility, slightly smaller discount (up to ~66 %).
  • EC2 Instance Savings Plans are tied to one family in one region (e.g. c7i in ca-central-1) but let you change size, OS and tenancy. Larger discount (up to ~72 %).
  • Payment options: No upfront, Partial upfront, All upfront; more upfront = bigger discount.
  • Plans apply across all accounts of an AWS Organization when consolidated billing is on.

AWS Cost Explorer’s Savings Plans recommendations analyse your last 7, 30 or 60 days and propose an hourly commitment. Start below the recommendation (60–70 % of steady usage) and add plans quarterly as usage stabilises; you can stack several plans.

aws savingsplans describe-savings-plans --query 'savingsPlans[].{id:savingsPlanId,type:savingsPlanType,commit:commitment,end:end}'
aws ce get-savings-plans-utilization --time-period Start=2026-08-01,End=2026-09-01 --granularity MONTHLY

Reserved Instances: still relevant, mostly outside EC2

An RI is a billing discount for a specific instance type (and optionally a specific AZ, which also reserves capacity) for 1 or 3 years. Standard RIs are size-flexible within a family on Linux; Convertible RIs can be exchanged for other types. For EC2, Savings Plans give the same discount with far less management, so new RIs are rare. RIs remain the only commitment discount for RDS, ElastiCache, OpenSearch, Redshift and DynamoDB, which is why you must still understand them.

Spot Instances: spare capacity at up to 90 % off

Spot sells unused capacity at a price that moves slowly with supply and demand. AWS can reclaim a Spot instance with a two-minute warning. The design rule: your workload must tolerate losing any instance at any time. The practical rule: diversify across many instance types and AZs so a shortage of one type does not stop you.

# Current Spot prices for a few candidates
aws ec2 describe-spot-price-history --instance-types m7g.large m6g.large c7g.large 
  --product-descriptions "Linux/UNIX" --start-time "$(date -u +%Y-%m-%dT%H:%M:%SZ)" 
  --query 'SpotPriceHistory[].{type:InstanceType,az:AvailabilityZone,price:SpotPrice}' --output table

# Inside an instance: poll the interruption notice (IMDSv2)
TOKEN=$(curl -sX PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 60")
curl -s -H "X-aws-ec2-metadata-token: $TOKEN" http://169.254.169.254/latest/meta-data/spot/instance-action

The best way to use Spot is through an Auto Scaling group with a mixed instances policy: a launch template, a list of 10+ instance types, the price-capacity-optimized allocation strategy and Capacity Rebalancing enabled so replacements start before the interruption.

{
  "LaunchTemplate": {
    "LaunchTemplateSpecification": { "LaunchTemplateName": "web-lt", "Version": "$Latest" },
    "Overrides": [
      { "InstanceType": "m7g.large" }, { "InstanceType": "m6g.large" },
      { "InstanceType": "c7g.large" }, { "InstanceType": "c6g.large" },
      { "InstanceType": "m7g.xlarge" }, { "InstanceType": "c7g.xlarge" }
    ]
  },
  "InstancesDistribution": {
    "OnDemandBaseCapacity": 2,
    "OnDemandPercentageAboveBaseCapacity": 25,
    "SpotAllocationStrategy": "price-capacity-optimized"
  }
}

Here two instances are always On-Demand (covered by a Savings Plan), and above that 75 % of additional capacity is Spot. Kubernetes users get the same result with Karpenter or EKS managed node groups set to capacityType: SPOT.

Dedicated Instances, Dedicated Hosts and Capacity Blocks

  • Dedicated Instances run on hardware used only by your account; AWS still chooses the host. You pay a regional per-hour surcharge. Needed for some compliance regimes.
  • Dedicated Hosts give you a whole physical server with visibility of sockets and cores, which is what per-socket or per-core software licences (Windows Server, SQL Server, Oracle) require when you bring your own licence. Billed per host, reservable for 1–3 years.
  • Capacity Blocks for ML let you reserve GPU (P5, P4d) or Trainium capacity for a defined window weeks ahead, solving the “no GPUs available” problem for training jobs.
  • On-Demand Capacity Reservations guarantee that N instances of a type can launch in an AZ; you pay whether or not you launch. Combine with Savings Plans for both discount and guaranteed capacity (DR sites, product launches).

Worked example: a web platform

Assume a fleet that never drops below 8 × m7g.large, averages 12, and peaks at 30 during campaigns; On-Demand list price ≈ 0.0816 USD/h per instance.

LayerInstancesOptionApprox. hourly cost
Baseline83-year EC2 Instance Savings Plan (m7g, no upfront, ~60 % off)8 × 0.033 ≈ 0.26 USD
Average extra4Spot (~70 % off)4 × 0.025 ≈ 0.10 USD
Peak extraup to 18Spot with On-Demand fallback≈ 0.45–1.50 USD only during peaks

Average hour ≈ 0.36 USD instead of 0.98 USD all On-Demand: roughly 63 % saved with no change to the application. The Savings Plan covers the part you are sure about; Spot handles the variable part; On-Demand is the safety net.

Common mistakes

  • Committing to 100 % of current usage; utilisation drops when you optimise later. Commit to 60–70 % and add over time.
  • Buying zonal RIs “for capacity” when a Capacity Reservation plus a Savings Plan would be more flexible.
  • Running stateful databases on Spot without a failover strategy.
  • Using a single Spot instance type; diversification is what makes Spot reliable.
  • Forgetting that Savings Plans do not cover EBS, data transfer or Elastic IPs; optimise those separately.

Key takeaways

  • On-Demand is the reference; every other option trades flexibility or reliability for a discount.
  • Savings Plans (spend commitment) have replaced RIs for EC2; RIs still matter for RDS and other services.
  • Spot gives the deepest discount for interruptible work; diversify types and use ASG mixed instances or Karpenter.
  • Dedicated options solve compliance and licensing, not cost; Capacity Blocks and Reservations solve availability.
  • Winning pattern: Savings Plan baseline + Spot burst + On-Demand safety net.

Next tutorial

Next: Launch an EC2 web server with a security group, then Auto Scaling with launch templates. Official docs: Instance purchasing options, Savings Plans.

Ressources liées sur le site

Retour parcours AWS — hub de la série et leçons sœurs.