
Fargate's serverless bliss costs 3x more than ECS on EC2: Time to rewrite Terraform configs and pretend you're saving thousands
AWS users can significantly reduce container costs by migrating from Fargate to ECS on EC2, with savings of up to 78% achievable through the use of Spot Instances. For example, running 10 containers on Fargate costs $360 per month, while the same workload on ECS with Reserved Instances costs $150 per month and with Spot Instances costs $80 per month. By utilizing Terraform and ECS capacity providers, users can achieve 90% of Fargate's convenience at 30% of the cost. This migration is particularly suitable for production workloads at scale, with predictable traffic patterns, where cost optimization is a priority. A case study of a startup running 25 microservices on Fargate found that migrating to ECS on EC2 with a mix of Spot and Reserved Instances resulted in annual savings of $18,840. With the help of Terraform, users can automate the migration process and take advantage of ECS on EC2's cost-effectiveness, making it an attractive option for companies looking to optimize their AWS expenses.