Advertisement
Beginner AWS, Amazon ECS (Elastic Container Service)

What is the difference between ECS Fargate launch type and ECS EC2 launch type?

Short answer

With the Fargate launch type, AWS manages the underlying compute infrastructure entirely, meaning you simply specify the resources your container needs and AWS runs it without you managing any servers, while the EC2 launch type requires you to provision and manage your own EC2…

Save AWS mock interview
Advertisement
AModel answer
With the Fargate launch type, AWS manages the underlying compute infrastructure entirely, meaning you simply specify the resources your container needs and AWS runs it without you managing any servers, while the EC2 launch type requires you to provision and manage your own EC2 instances that ECS then uses to run your containers, giving you more control but also more operational responsibility.
Example

aws ecs create-service --cluster my-cluster --service-name my-service --launch-type FARGATE

Real-world example
A small team without dedicated infrastructure staff chooses the Fargate launch type to avoid managing EC2 instances, while a company with existing reserved EC2 capacity chooses the EC2 launch type to reduce cost by fully utilizing that capacity.
Likely follow-ups
  • How does pricing differ between Fargate and EC2 launch types?
  • Can a single ECS cluster run both launch types together?
Related topics