fargate-spotaws-fargate-spotfargate-spot-pricing

AWS Fargate Spot: Pricing, Savings, and When to Actually Trust It

Fargate Spot runs your ECS containers on spare AWS capacity — same runtime, same task definition, 50–70% cheaper. The reason most teams haven't turned it on: they're not sure what happens when AWS reclaims that capacity mid-request.

Below: real pricing math, the stopTimeout gotcha that costs teams their full 2-min window, and a workload grid so you can decide in 10 minutes.

50–70%
off on-demand — variable, set by AWS supply/demand
aws.amazon.com/fargate/pricing
2 min
SIGTERM warning before interruption
AWS ECS docs (fargate-capacity-providers)
30 s
default stopTimeout — not 120 s. Fix this first.
AWS ECS docs (stopTimeout default)
0
on-demand fallback when Spot unavailable — tasks queue
AWS ECS docs (verbatim)

What is Fargate Spot?

Fargate Spot is a capacity provider built into ECS. It runs your containers on spare AWS compute at a discount — the same Fargate runtime, the same task definition, no EC2 nodes to manage. When AWS needs that capacity back, your tasks get a two-minute warning and stop.

You enable it through a capacity provider strategy on your ECS cluster. No task definition changes. No new IAM roles. No ALB reconfiguration. The difference is purely in how AWS schedules your containers and what you pay.

Two built-in capacity providers
FARGATE — on-demand, always available, full price
FARGATE_SPOT — spare capacity, 50–70% cheaper, interruptible

What Fargate Spot actually costs

AWS publishes current Spot rates on the Fargate pricing page (the "Current Spot price" table, updated dynamically). The rates are not a fixed 70% discount — they adjust gradually based on long-term trends in supply and demand, per AWS. The range is 50–70% off on-demand; 70% is the ceiling, not the typical case.

ArchitecturevCPU / hrGB / hr1 vCPU + 2 GB / mo
x86 on-demand$0.04048$0.004446$36.04
ARM on-demand$0.03238$0.003560$28.84
x86 Spot (50% off)~$0.0202~$0.00222~$18.02
x86 Spot (70% off)~$0.0121~$0.00133~$10.81
ARM Spot (50% off)~$0.0162~$0.00178~$14.42
ARM Spot (70% off)~$0.0097~$0.00107~$8.65

On-demand rates: us-east-1, Linux, verified June 2026 from aws.amazon.com/fargate/pricing. Spot ranges are illustrative (50–70% off on-demand); actual rate varies — check the live Spot table on the same page. ARM savings apply if your container image is built for linux/arm64.

Fleet example: 10 services × (1 vCPU + 2 GB), us-east-1. x86 on-demand: $360/mo. ARM Spot at 70% off: $87/mo — saving $274/mo without changing a single line of application code.

The interruption mechanics — and the stopTimeout gotcha

When AWS needs capacity back, it sends a two-minute warning — simultaneously:

1. SIGTERM signal to the running container
2. Task state change event to EventBridge (stopCode: "SpotInterruption")

Your container has that window to finish in-flight work, drain connections, and exit cleanly. If it doesn't exit within stopTimeout, ECS sends SIGKILL — hard stop, possible data loss.

The gotcha most teams miss

The default stopTimeout is 30 seconds — not 120. AWS gives you a 2-minute warning, but unless you explicitly set stopTimeout: 120 in your task definition, ECS sends SIGKILL after just 30 seconds. You silently lose 90 seconds of grace window.

Task definition snippet — fix this first
"containerDefinitions": [{
"name": "app",
"stopTimeout": 120, // raise from 30s default
...
}]

Source: AWS ECS docs — Fargate Spot termination notices (verified June 2026)

The no-fallback rule most teams discover the hard way

When Fargate Spot capacity is unavailable — during high-demand periods — ECS does not automatically switch your tasks to on-demand. AWS is explicit about this:

“Fargate doesn't replace Spot capacity with on-demand capacity.”

AWS ECS Developer Guide, verified June 2026

What happens instead: ECS services retry launching tasks until Spot capacity returns. A service running a single Spot task will be interrupted and stay interrupted until AWS has spare capacity again.

The fix is the mixed capacity-provider strategy in the next section — not treating Spot as a drop-in replacement for on-demand.

Which workloads belong on Spot

The decision comes down to one question: can this workload restart cleanly from a 2-minute warning?

WorkloadSpot?Notes
Dev environmentsInterruptions are low-stakes; restart is instant
Staging / preview environmentsSame — non-customer-facing
Batch / data pipeline tasksDesign for retry; Spot is the default
CI runnersEphemeral by design — perfect fit
Stateless prod API (multi-task)~Mixed strategy: on-demand base + Spot weight
Single-replica serviceNo fallback = interruption means downtime
Long stateful job / DB migrationCan't checkpoint; 2-min warning is too short

For stateless production APIs, use the mixed strategy below — not pure Spot. The Fargate on-demand pricing breakdown explains what you're paying per environment before Spot.

Mixed capacity-provider strategy

Set base=1 on FARGATE so at least one task is always on on-demand. Set weight=3 on FARGATE_SPOT for the rest. ECS fills the base first, then places ~75% of additional tasks on Spot. If Spot is interrupted, the on-demand base task stays up; ECS retries the Spot tasks.

Terraform — aws_ecs_cluster_capacity_providers
resource "aws_ecs_cluster_capacity_providers" "main" {
cluster_name = aws_ecs_cluster.main.name
capacity_providers = ["FARGATE", "FARGATE_SPOT"]
# first task always on-demand
default_capacity_provider_strategy {
base = 1
weight = 1
capacity_provider = "FARGATE"
}
# ~75% of remaining tasks on Spot
default_capacity_provider_strategy {
weight = 3
capacity_provider = "FARGATE_SPOT"
}
}

Only one capacity provider can have a base value. At least one provider must have weight > 0. Max 20 capacity providers per strategy. Source: AWS ECS docs.

Spot + scheduling: where the real savings compound

Fargate Spot cuts your per-hour rate by 50–70%. Scheduling environments off at nights and weekends cuts your billable hours by ~65%. Stack them and the math gets interesting:

10 services × 1 vCPU + 2 GB, us-east-1
x86 on-demand, 24/7$360 /mo
→ Spot (60% off avg)$144 /mo
→ Schedule off nights + weekends (−65% hrs)~$50 /mo
Total reduction vs always-on on-demand−86%

Spot is a rate lever you set once per cluster. Scheduling is an operations lever — it needs to run across 10+ environments, respect team hours, handle exceptions, and not wake up the on-call when it fires at 2am. That's the part Fortem handles.

See your Spot + scheduling savings

Fleet Audit scans your ECS environments and shows exactly which services are Spot candidates, what they cost now, and what they'd cost on a schedule. Free, read-only, runs locally in 15 minutes.

FAQ

Is Fargate Spot reliable enough for production?
For stateless production services, yes — with a mixed capacity-provider strategy (on-demand base + Spot weight). Set base=1 on FARGATE so at least one task is always on on-demand. Spot tasks handle burst traffic and get replaced if interrupted. Single-replica stateful services should stay on on-demand.
How often does AWS interrupt Fargate Spot tasks?
AWS doesn't publish interruption frequency data for Fargate Spot — there's no Fargate Spot Advisor (unlike EC2 Spot). The <5% average interruption rate cited online applies to EC2 Spot instances, not Fargate Spot. In practice, interruptions are rare in most regions but unquantifiable from public data.
What happens if there's no Fargate Spot capacity in my region?
ECS does not fall back to on-demand. Per AWS docs: 'Fargate doesn't replace Spot capacity with on-demand capacity.' Tasks stay in PROVISIONING and retry until Spot capacity returns. A service with only one Spot task will be interrupted until capacity is available. Use a mixed capacity-provider strategy with an on-demand base to avoid this.
Can I use Fargate Spot with existing task definitions?
Yes — task definitions are identical between Fargate and Fargate Spot. The only change is the capacity provider strategy on your ECS cluster and service. You don't need to modify task definitions, IAM roles, or ALB configuration.
How do I handle in-flight HTTP requests during a Spot interruption?
Configure your container to handle SIGTERM gracefully: stop accepting new connections, finish in-flight requests, then exit. Set stopTimeout to 120 seconds in your task definition (default is 30s — too short for most web servers). If behind an ALB, ECS drains the target before stopping the task.
Related