# AWS ECS

> Amazon ECS is a fully managed container orchestration service to deploy, manage and scale Docker containers on EC2 instances or AWS Fargate.

- Source: https://www.itwonderlab.com/aws-ecs/
- Published: 2023-11-22
- Updated: 2026-10-05
- Author: Javier Ruiz Jiménez (https://www.javierruizjimenez.com/)
- Site: IT Wonder Lab (https://www.itwonderlab.com/)

---

## Amazon Elastic Container Service

AWS ECS (Amazon Elastic Container Service) is a fully managed container orchestration service for deploying, managing, and scaling containerized applications using Docker containers. ECS allows users to easily run containerized applications on a cluster of [EC2](https://www.itwonderlab.com/aws-ec2/) instances or with [AWS Fargate](https://www.itwonderlab.com/aws-fargate/), handling tasks like scheduling, scaling, and load balancing.

### Key concepts

- **Cluster**: a logical group of tasks and services and of the capacity that runs them.
- **Task definition**: the blueprint of an application: the container images (from [ECR](https://www.itwonderlab.com/aws-ecr/) or Docker Hub), CPU and memory, ports, environment variables, logging and the [IAM](https://www.itwonderlab.com/aws-iam/) roles.
- **Task**: a running instance of a task definition. **Service**: keeps the desired number of tasks running and can register them in a [load balancer](https://www.itwonderlab.com/aws-elastic-load-balancing/).
- **Capacity**: [AWS Fargate](https://www.itwonderlab.com/aws-fargate/) (serverless, no instances to manage) or [EC2](https://www.itwonderlab.com/aws-ec2/) instances in an [Auto Scaling group](https://www.itwonderlab.com/aws-auto-scaling/).
- **Networking**: the `awsvpc` mode gives each task its own network interface in a [subnet](https://www.itwonderlab.com/aws-subnets/) of a [VPC](https://www.itwonderlab.com/aws-vpc/), protected by [security groups](https://www.itwonderlab.com/aws-security-groups/).

### Pricing

ECS has no additional charge: you pay for the EC2 instances or the Fargate resources that run the tasks.

### With Terraform

The resources are `aws_ecs_cluster`, `aws_ecs_task_definition`, `aws_ecs_service` and `aws_ecs_cluster_capacity_providers`.

See also: [AWS EKS](https://www.itwonderlab.com/aws-eks/), the managed Kubernetes alternative.

See tutorials:

-   [How to Deploy Containers in AWS ECS with Terraform and Fargate](https://www.itwonderlab.com/containers-aws-ecs-terraform-fargate/)
