SaveMyCert
Log in
2 of 2 free questions left today·for 5 a day
Design Cost-Optimized Architectures

Cost-Optimized Compute: Spot vs Reserved vs Savings Plans, and Lambda vs EC2

24 min readSAA-C03 · Design Cost-Optimized ArchitecturesUpdated

Cost-optimized compute is compute that meets every stated requirement — performance, availability, interruption tolerance, location — at the lowest total price. SAA-C03 Task 4.2 tests it through four decisions: how to pay (On-Demand, Reserved Instances, Savings Plans, Spot, and how to layer them and size the commitment); what to run on (Lambda, Fargate or EC2, and which instance family, size and generation); how capacity follows demand (horizontal versus vertical scaling, scheduled versus dynamic scaling, hibernation, non-production schedules); and where the work runs (CloudFront edge caching and edge functions, Local Zones, Outposts and Wavelength, and the right load balancer). It also covers the cost tools that make those decisions visible across accounts: Compute Optimizer, Cost Explorer, AWS Budgets, the Cost and Usage Report, cost allocation tags and consolidated billing. Questions nearly always ask for the MOST cost-effective design: several options run the workload, and one pays the least without breaking a requirement. By the end of this lesson you will map any workload shape to a purchase mix and a compute service, size a commitment correctly, and explain why each losing option overpays or breaks a constraint.

What you’ll learn

  • Choose among On-Demand, Standard and Convertible Reserved Instances, Compute and EC2 Instance Savings Plans, and Spot, and know which discounts reach Fargate and Lambda
  • Size a commitment to the measured hourly floor — after existing Reserved Instances, after right-sizing — knowing it bills every hour of the term
  • Build an Auto Scaling group with a mixed instances policy, and an ECS capacity provider strategy that mixes FARGATE and FARGATE_SPOT
  • Right-size with Compute Optimizer, pick the instance family by bottleneck, and use cost allocation tags, Cost Explorer, Budgets and the CUR for the right jobs
  • Compare Lambda, Fargate and EC2 by utilization, and pick scheduled, dynamic or no scaling — or hibernation — for a given demand pattern
  • Choose between CloudFront Functions and Lambda@Edge, between Local Zones, Outposts and Wavelength, and between ALB, NLB and Gateway Load Balancer

The 12 parts · about 22 min of reading

  1. The four ways to pay for EC2Start hereInstruments that lock an instance family discount most (up to 72%); Compute Savings Plans follow usage anywhere for up to 66%.2 min
  2. The layered mixCommit to the measured hourly floor, run variable load On-Demand behind Auto Scaling, and push interruptible work onto Spot.2 min
  3. Spot done safelyUse a mixed instances policy with a small On-Demand base and Spot diversified across instance types and AZs to absorb reclaims.2 min
  4. Right-sizing: Compute Optimizer, families, generations, and GravitonFix the size and family first using Compute Optimizer, then discount what remains, since a commitment on an oversized fleet locks in waste.2 min
  5. Cost visibility across accountsCompute Optimizer recommends, Cost Explorer analyzes, Budgets alerts, the CUR itemizes, and activated tags attribute spend.2 min
  6. Lambda vs Fargate vs EC2Utilization decides: low or spiky volume suits Lambda, sustained high load suits EC2 with commitments, and Fargate fits modest containers.3 min
  7. Scaling as a savings leverReleased capacity stops billing, so match scaling method to the demand pattern and run non-production only when used, never reserved.2 min
  8. Edge offloadCaching at the edge sizes the origin for cache misses, and simple no-network logic on viewer events is cheapest as CloudFront Functions.1 min
  9. Hybrid and edge placementChoose by where compute must sit: Local Zones for metro latency without hardware, Outposts when data must stay on premises.1 min
  10. Choosing the load balancerChoose by protocol and job: one ALB with routing rules replaces many, NLB carries UDP with static IPs, GWLB runs inline appliances.1 min
  11. Worked scenarioA Compute Savings Plan covers the floor through a family change, On-Demand Auto Scaling covers daytime, and Spot runs checkpointed batch.2 min
  12. Worked scenarioA retryable queue-driven fleet goes mostly Spot, diversified across types and AZs, with a small On-Demand base so the queue keeps draining.2 min

Mind map

Standard RI / EC2 Instance SP: up to72%Compute SP: up to 66%, covers Fargate,LambdaSpot: up to 90%, two-minute reclaimnoticeCapacity Reservations guarantee, neverdiscount1✓EC2 purchase optionsCommit to the measured hourly floorVariable load: On-Demand behind AutoScalingCommitments can't follow a scheduleSize new plans after existing RIs2✓Layered purchase mixSpot only for stateless or retryableworkMixed instances policy with On-DemandbaseDiversify types and AZs across SpotpoolsNo bidding: reclaims follow capacity3✓Spot done safelyCompute Optimizer findsover-provisioningMatch family to bottleneck: m, c, r,i, gNewer generations and Graviton costlessRight-size before buying a commitment4✓Right-sizing computeOptimizer recommends, Cost ExploreranalyzesBudgets alerts, CUR itemizes, tagsattributeTags count only once activatedConsolidated billing shares RI and SPdiscounts5✓Cost tools acrossaccountsLow, spiky volume → Lambda (15-minutelimit)Sustained high utilization → EC2 +commitmentsFargate bills requested vCPU andmemoryFARGATE base, heavier FARGATE_SPOTweight6✓Lambda vs Fargate vs EC2Scale-in is the half that saves moneyKnown ramps → scheduled scalingactionsStop non-production when idle; neverreserve itHibernation: enable at launch, RAM <150 GiB7✓Scaling as a savingsleverCaching sizes the origin for missesonlyCloudFront Functions: cheap, nonetwork callsLambda@Edge for network calls or bodyaccessViewer functions run even on cachehits8✓Edge offload withCloudFrontLocal Zones: metro latency, pay peruseOutposts: data stays on premises, termcommitWavelength: low latency on carrier 5GSnowball Edge closed to new customers9✓Local Zones, Outposts,WavelengthOne ALB with host/path rules replacesmanyNLB: UDP plus static IP per AZGWLB runs third-party appliancesinline10✓Load balancer choiceFamily change ahead → Compute SavingsPlanDaytime peak → On-Demand with AutoScalingCheckpointed batch → diversified SpotCommitting to peak idles capacityovernight11✓Layering the purchase mixSmall On-Demand base keeps the queuedrainingMany types and AZs,price-capacity-optimizedHandle the notice; SQS visibilityretries jobsLambda fails: jobs can exceed 15minutes12✓Interruption-proof SpotfleetCost-optimizedcompute
Mind map

Cost-Optimized Compute: Spot vs Reserved vs Savings Plans, and Lambda vs EC2

Standard RI / EC2 Instance SP: up to72%Compute SP: up to 66%, covers Fargate,LambdaSpot: up to 90%, two-minute reclaimnoticeCapacity Reservations guarantee, neverdiscount1✓EC2 purchase optionsCommit to the measured hourly floorVariable load: On-Demand behind AutoScalingCommitments can't follow a scheduleSize new plans after existing RIs2✓Layered purchase mixSpot only for stateless or retryableworkMixed instances policy with On-DemandbaseDiversify types and AZs across SpotpoolsNo bidding: reclaims follow capacity3✓Spot done safelyCompute Optimizer findsover-provisioningMatch family to bottleneck: m, c, r,i, gNewer generations and Graviton costlessRight-size before buying a commitment4✓Right-sizing computeOptimizer recommends, Cost ExploreranalyzesBudgets alerts, CUR itemizes, tagsattributeTags count only once activatedConsolidated billing shares RI and SPdiscounts5✓Cost tools acrossaccountsLow, spiky volume → Lambda (15-minutelimit)Sustained high utilization → EC2 +commitmentsFargate bills requested vCPU andmemoryFARGATE base, heavier FARGATE_SPOTweight6✓Lambda vs Fargate vs EC2Scale-in is the half that saves moneyKnown ramps → scheduled scalingactionsStop non-production when idle; neverreserve itHibernation: enable at launch, RAM <150 GiB7✓Scaling as a savingsleverCaching sizes the origin for missesonlyCloudFront Functions: cheap, nonetwork callsLambda@Edge for network calls or bodyaccessViewer functions run even on cachehits8✓Edge offload withCloudFrontLocal Zones: metro latency, pay peruseOutposts: data stays on premises, termcommitWavelength: low latency on carrier 5GSnowball Edge closed to new customers9✓Local Zones, Outposts,WavelengthOne ALB with host/path rules replacesmanyNLB: UDP plus static IP per AZGWLB runs third-party appliancesinline10✓Load balancer choiceFamily change ahead → Compute SavingsPlanDaytime peak → On-Demand with AutoScalingCheckpointed batch → diversified SpotCommitting to peak idles capacityovernight11✓Layering the purchase mixSmall On-Demand base keeps the queuedrainingMany types and AZs,price-capacity-optimizedHandle the notice; SQS visibilityretries jobsLambda fails: jobs can exceed 15minutes12✓Interruption-proof SpotfleetCost-optimizedcompute

How the exam tests this

SAA-C03 tests this task with MOST cost-effective scenarios where several designs run the workload and one pays least without breaking a requirement. The flagship shape is the layered purchase mix — a baseline, a variable peak and a batch tier — graded on matching commitments, On-Demand with Auto Scaling, and Spot to the right layers. Expect commitment-sizing traps (a plan cannot be scheduled, its hourly amount does not shrink when you downsize, existing RIs are applied first, Cost Explorer recommendations mirror today's over-provisioned usage), Compute versus EC2 Instance Savings Plans decided by a move to Fargate or Lambda, Spot and Fargate Spot resilience details (On-Demand base, diversified pools, capacity provider base and weight), Lambda-vs-Fargate-vs-EC2 choices decided by utilization, target tracking versus scheduled scaling, hibernation prerequisites, cost-tool and consolidated-billing questions, CloudFront Functions versus Lambda@Edge, Local Zones versus Outposts, and ALB versus NLB versus Gateway Load Balancer. When two options both work, the one that right-sizes first, commits only to the steady floor and pushes interruptible work to Spot usually pays least. Distractor patterns: committing to peak, Reserved capacity for part-time workloads, Spot under stateful or baseline tiers, Capacity Reservations offered as a saving, per-service load balancers, and serverless proposed for a sustained, always-hot workload.

Key takeaways

  1. Layer the purchase mix: commitments sized to the steady baseline, On-Demand behind Auto Scaling for the variable layer, Spot (up to 90% off) for interruptible work — never commit to peak, never put un-interruptible work on Spot.
  2. Depth versus flexibility: Standard RIs and EC2 Instance Savings Plans go up to 72% but lock a family; Compute Savings Plans go up to 66% but follow usage anywhere, including Fargate and Lambda, which no EC2-only instrument covers.
  3. A commitment is one hourly amount billed every hour of the term: it cannot be scheduled, its flexibility moves the discount but not the bill, RIs are applied before Savings Plans — so right-size first and size the plan to the uncovered floor.
  4. Spot is safe only for stateless, retryable or checkpointable work, in an ASG mixed instances policy (On-Demand base, many types across AZs, price-capacity-optimized); on ECS, put the base on FARGATE and the larger weight on FARGATE_SPOT.
  5. Pick the cost tool by job: Compute Optimizer recommends, Cost Explorer analyzes (its purchase recommendations follow current usage), Budgets alerts, the CUR itemizes, and tags count only after activation in the management account; consolidated billing shares commitments by default.
  6. Pick compute by utilization: Lambda for low or spiky volume, EC2 with commitments for sustained load, Fargate for containers without cluster management — and Fargate bills the vCPU and memory a task requests.
  7. Match scaling to demand: target tracking for unpredictable load, scheduled actions for clock-predictable ramps with slow-starting instances, scheduled stop/start for non-production; hibernation (enabled at launch, Linux RAM under 150 GiB, encrypted EBS root) for intermittent instances with long warm-up.
  8. Offload and place wisely: CloudFront caching shrinks the origin; CloudFront Functions beat Lambda@Edge for simple high-volume viewer logic; Local Zones (AWS-run metro) vs Outposts (your premises) vs Wavelength (5G); one ALB for many HTTP services, NLB for UDP and static IPs, GWLB for inline appliances.
0/12
Ready to start

Part 1: The four ways to pay for EC2

Instruments that lock an instance family discount most (up to 72%); Compute Savings Plans follow usage anywhere for up to 66%.

2 min read · 12 parts, about 22 min in allStart lesson

Frequently asked questions

What is the difference between Spot, Reserved Instances, and Savings Plans?

They discount EC2 in exchange for different concessions. Reserved Instances and Savings Plans trade a 1- or 3-year commitment for a discount: Standard RIs and EC2 Instance Savings Plans go up to 72% but lock an instance family, while Convertible RIs and Compute Savings Plans go up to 66% and allow change — Compute Savings Plans also cover Fargate and Lambda. RIs commit to an instance configuration; Savings Plans commit to an hourly spend amount billed every hour of the term. Spot trades reliability instead: up to 90% off spare capacity that AWS can reclaim with a two-minute notice, so it suits only interruption-tolerant work like batch processing, CI and queue-driven jobs.

Should I choose Savings Plans or Reserved Instances?

For most EC2 commitments today, Savings Plans. A Compute Savings Plan (up to 66% off) keeps its discount when you change instance family, size, OS or Region and also covers Fargate and Lambda; an EC2 Instance Savings Plan matches the Standard RI discount (up to 72%) if you can commit to one family in one Region. Convertible RIs allow exchanges between EC2 configurations; Standard RIs cannot be exchanged, though they can be modified (Availability Zone, scope, or size within the family for Linux). If you already hold RIs, remember they are applied before any Savings Plan, so size a new plan to the steady usage the RIs leave uncovered. When usage may move to containers or serverless, only the Compute Savings Plan follows it.

When should I use Spot Instances?

Use Spot when the workload can be interrupted and resumed or retried without harm: batch and big-data processing, video transcoding, CI/CD builds, rendering, containerized workers, and queue-driven jobs where a killed task returns to the queue. AWS reclaims Spot capacity with a two-minute notice, so never use it for databases, stateful applications, or the only capacity behind user-facing traffic. Run Spot inside an Auto Scaling group mixed instances policy — a small On-Demand base, diversified instance types across Availability Zones, and the price-capacity-optimized allocation strategy — so a reclaimed pool costs you a slice of capacity, not the whole fleet.

Sign up free to mark lessons complete, bookmark topics and track your exam readiness.

Spotted a mistake in this lesson?