Amazon ECS
AWS-native container orchestration service that runs and scales Docker containers without you managing a control plane.
Verified against AWS documentation · 2026-08-28
Key facts
- 01Hierarchy: cluster → service → task → container; the task definition is the blueprint (image, CPU/memory, ports, IAM role)
- 02Two launch types the exam cares about: EC2 (you manage the instances) and Fargate (serverless — AWS manages compute)
- 03Task role ≠ instance role: the task IAM role grants permissions to the containers, not to the host
- 04The service scheduler keeps the desired task count running and replaces failed tasks automatically; pair with ALB for web traffic
Exam triggers
Phrases and scenarios that point here.
- "Run Docker containers" + "AWS-native" / "least operational overhead" → ECS, usually on Fargate
- "No infrastructure to manage" or "serverless containers" → Fargate launch type
- "Full control over the underlying instances" (GPU, custom AMI, daemon agents) → EC2 launch type
- Containers need AWS API access → task IAM role, never hardcoded credentials
Not this service
- Kubernetes required (existing manifests, Helm, multi-cloud portability) → EKS
- Just storing container images → ECR
- Simple web app from code without touching orchestration → App Runner
Use cases
- 01Lifting a Docker Compose side project into production: same containers, but ECS restarts them when they crash at 3 a.m. instead of you
- 02Microservices behind an ALB, where each service scales its task count independently — checkout scales up on payday, search doesn't
- 03Scheduled batch jobs (nightly ETL, report generation) as Fargate tasks fired by EventBridge — compute exists only for the minutes the job runs
- 04Bursty workloads on Fargate: think of EC2 launch type as owning a car and Fargate as taking taxis — taxis win when trips are short and unpredictable
- 05Hybrid teams using EC2 launch type to bin-pack many small containers onto reserved instances they already pay for
How it's charged
- 01ECS itself is free — no control plane fee (unlike EKS's per-cluster charge). You pay only for the compute underneath
- 02EC2 launch type: you pay normal EC2/EBS rates for the instances, whether tasks are running or not — idle capacity is your cost
- 03Fargate: billed per second (1-minute minimum) on vCPU + memory allocated to the task — over-sized task definitions are pure waste
- 04Fargate Spot and Graviton (ARM) each cut Fargate cost significantly for interruptible or portable workloads
- 05Usual extras apply: data transfer out, NAT gateway hours if tasks in private subnets pull images from the internet, ALB hours