Free tool
ECS cost calculator
Describe your services and compare what they cost per month on Fargate and on EC2, with Spot where they allow it, from AWS's current list prices.
Questions
How much does Fargate cost per month?
A task with 1 vCPU and 2 GB of memory that runs all month costs about $36 on Linux in us-east-1 (730 hours at $0.04048 per vCPU-hour and $0.004445 per GB-hour). ARM tasks cost about 20% less, and Fargate Spot up to 70% less. Rates differ by region, so pick yours in the calculator above.
Does Amazon ECS itself cost anything?
No. ECS has no cluster or control plane fee. You pay for what your tasks run on, Fargate or EC2 instances, plus what they use around them, such as load balancers, data transfer and logs.
How is Fargate priced?
Fargate bills the vCPU and memory a task asks for, not what it uses, by the second from when the image download starts until the task stops. Linux tasks have a one-minute minimum. Ephemeral storage above the free 20 GiB costs extra.
Is ARM cheaper on Fargate?
Yes. Fargate on Graviton (ARM64) costs about 20% less per vCPU and GB than x86 in most regions. Your images need to be built for ARM64, which multi-platform builds do in one step.
When is EC2 cheaper than Fargate?
When you keep your instances well packed. EC2 costs less per vCPU and GB, but you pay for whole instances, including the capacity no task reserves. Fargate charges only for what tasks reserve, so small or spiky workloads are often cheaper there. EC2 also needs upkeep: you patch the instances, update the ECS agent and scale the cluster yourself.
What is Fargate Spot?
Fargate Spot runs tasks on spare AWS capacity, at up to 70% off. AWS can stop Spot tasks with a two-minute warning, so it suits workloads that can be interrupted. AWS doesn't publish Spot rates, so the calculator uses the discount you enter.
Do Savings Plans change whether Fargate or EC2 is cheaper?
They can. A Compute Savings Plan covers both, but EC2 gets a bigger discount: with no upfront payment, typically about 24% for one year and 48% for three years, against about 15% and 40% for Fargate. Savings Plans don't cover Spot. Pick a term under General to apply typical discounts, which you can adjust.
What does the calculator leave out?
Load balancers, NAT gateways, data transfer, CloudWatch logs and EBS volumes for EC2 instances. Prices are On-Demand list prices, unless you pick a Savings Plan, and don't include Reserved Instances or other discounts.
More on the choice in Fargate vs EC2 for Amazon ECS. Need the IAM roles too? Generate them with the ECS IAM policy generator.