AWS › AWS Fargate

How does Fargate pricing work compared to paying for EC2 instances directly?

Beginner

Answer

Fargate pricing is based on the exact amount of vCPU and memory resources your tasks actually request and consume for the duration they run, billed per second, meaning you pay precisely for what your containers use without needing to estimate or pre provision instance capacity ahead of time, which can be more cost effective for variable or unpredictable workloads, though it is often more expensive than well utilized, reserved EC2 capacity for steady, predictable workloads.
aws ecs describe-tasks --cluster my-cluster --tasks task-12345
Real-world example A company running a workload with highly unpredictable, bursty traffic patterns chooses Fargate to avoid overpaying for idle reserved EC2 capacity, accepting a slightly higher per unit cost in exchange for precise, usage based billing.

Common follow-ups: When does it make more financial sense to use EC2 instead of Fargate?;Does Fargate support Spot pricing for additional savings?