aws_ecs_cluster cost estimation
An ECS cluster. The cluster itself is free. Cost comes from the EC2 instances and Fargate tasks that run inside it.
An aws_ecs_cluster is a logical grouping for ECS tasks and services. Unlike EKS, ECS clusters have no per-cluster control-plane fee. The cluster resource is entirely free.
All ECS cost comes from compute used by services and standalone tasks within the cluster:
EC2 launch type: tasks run on EC2 instances registered to the cluster (typically via an Auto Scaling Group with the ECS-optimized AMI). You pay regular EC2 prices.
Fargate launch type: tasks run on AWS-managed compute, billed per vCPU-hour and GB-hour at the task level.
Capacity providers (CAPACITY_PROVIDER strategy) mix these: a service can run partly on EC2 spot, partly on Fargate, partly on Fargate Spot, etc.
Cluster-level features that DO cost extra are managed by separate resources: - Container Insights (CloudWatch metrics): enabled by container_insights setting. CloudWatch metric fees apply. - Capacity Providers: configuration is free; the underlying compute they provision is what costs. - Cluster Auto Scaling: free as a feature; you pay for the EC2 it provisions.
Compared to EKS, ECS saves ~$73/month per cluster (no control plane fee). Trade-off is fewer features and tighter AWS lock-in.
c3x estimates the cluster as $0 (free) but the services and tasks running inside it (aws_ecs_service, aws_ecs_task_definition) contribute their own costs.
Terraform example
A minimal but realistic configuration that C3X can estimate.
resource "aws_ecs_cluster" "production" {
name = "production"
setting {
name = "containerInsights"
value = "enabled"
}
}
resource "aws_ecs_cluster_capacity_providers" "production" {
cluster_name = aws_ecs_cluster.production.name
capacity_providers = ["FARGATE", "FARGATE_SPOT"]
default_capacity_provider_strategy {
capacity_provider = "FARGATE"
weight = 70
base = 1
}
default_capacity_provider_strategy {
capacity_provider = "FARGATE_SPOT"
weight = 30
}
}Pricing dimensions
What you actually pay for when you provision aws_ecs_cluster.
| Dimension | Unit | What's being charged |
|---|---|---|
| Cluster | free | The cluster resource itself has no charge. All cost comes from the compute it hosts. $0 |
| Container Insights metrics | per metric per month | If containerInsights = enabled, CloudWatch metric charges apply (typically $0.30/metric/month). |
| Tasks and services | see linked resources | All compute cost is in aws_ecs_service and the underlying aws_instance (EC2 launch type) or Fargate compute. |
Optimization tips
Common ways to reduce aws_ecs_cluster cost without changing the workload.
Disable Container Insights in non-production
Workload-dependentContainer Insights adds CloudWatch metric fees per task. For dev/staging where deep observability isn't needed, leave it disabled.
Consolidate clusters by environment
Operational simplicityEach ECS cluster has no charge, but each comes with operational overhead (separate IAM, separate task definitions, separate CI/CD targets). Don't proliferate clusters unnecessarily, but no cost penalty for doing so.
Use ECS over EKS when feature parity allows
$73/month per ECS cluster vs EKSAurora, Kafka, and other non-Kubernetes-native services are easier on ECS. The $73/month EKS control plane savings adds up across environments.
FAQ
Why does ECS not charge for the control plane like EKS does?
ECS is a proprietary AWS service with a managed control plane built into the AWS platform. EKS runs a managed Kubernetes API server which has higher operational overhead, justifying the fee. ECS's simpler model means AWS can offer it free.
Is Container Insights worth enabling?
For production with active observability practices, yes. For dev/staging or simple services, it adds CloudWatch costs without much value. Estimate before enabling: each task with default metrics is ~$3-5/month at CloudWatch rates.
Does c3x include the EC2 nodes for ECS EC2 launch type?
If those nodes are declared as aws_instance in your Terraform (typical for EC2 launch type), c3x estimates them as EC2 instances. The ECS service is then billed at $0 for its compute, with the EC2 cost on the linked instance line.
What about Container Insights with enhanced metrics?
Enhanced Container Insights for ECS (the newer tier) costs more per metric but provides per-container metrics. Best for production with active SRE practices. c3x estimates CloudWatch metric counts based on declared dimensions.
Related resources
Estimate this resource in your own Terraform
Free, open source, no API key. C3X parses your Terraform and shows line-item cost for every resource, including aws_ecs_cluster.