When running services on AWS ECS, should you run on AWS Fargate directly or organize them into ECS Clusters?

Viewed 85

ECS Clusters have a way to add "capacity providers", which can either be EC2 instances or Fargate. Separately, all tasks/services can also be placed directly on a single cluster that runs on Fargate.

What are some benefits to organize services and tasks into separate ECS Clusters? Or is it better to forego clusters altogether and use Fargate directly? Mainly thinking about network isolation, cross-AZ availability, etc. and seems like both solutions could work.

1 Answers

What are some benefits to organize services and tasks into separate ECS Clusters?

The primary benefit is with EC2 deployments, or mixed/hybrid EC2/Fargate deployments.

Or is it better to forego clusters altogether and use Fargate directly?

That's not possible. You have to have a cluster. Cluster ID is a required parameter of any ECS deployment. You might have a single ECS cluster (with no EC2 instances) that you deploy all your Fargate tasks to, but you still have to have that cluster defined as part of your Fargate deployment.

The cluster settings are were you define some things like ecs exec support, and capacity providers (Fargate vs Fargate Spot deployments for example). So even if you are only using Fargate, it may still make sense to split those ECS services into separate ECS clusters so you can configure some things separately, monitor them separately, etc.

Related