Getting Started with AWS ECS
Welcome to AWS ECS
Amazon ECS (Elastic Container Service) is AWS's container orchestration service. You define what Docker image to run, how much CPU and memory it needs, and how many copies you want — ECS handles the rest: scheduling, placement, health monitoring, and rolling updates.
It's the answer to "I built a Docker image, now how do I run it in production on AWS?"
Fargate vs. EC2 Launch Type
ECS supports two ways to run containers:
| Fargate | EC2 Launch Type | |
|---|---|---|
| Server management | None — AWS manages it | You manage the EC2 instances |
| Pricing | Per vCPU/memory per second | EC2 instance hours |
| Best for | Most workloads — simplest path | When you need specific instance types or GPU |
| Cold start | Slight startup delay | Containers start faster on warm instances |
Start with Fargate. You get the benefits of containers without managing servers.
What You'll Learn
- Clusters — the logical boundary that groups ECS resources
- Task definitions — the blueprint for your container (image, CPU, memory, env vars, ports)
- Tasks vs. services — one-off runs vs. long-running services that maintain a desired count
- Fargate launch type — running containers without EC2 instances
- Load balancer integration — connecting an ALB to distribute traffic across ECS tasks
- ECR integration — pulling images from your private ECR registry
- Environment variables and secrets — injecting config from SSM Parameter Store
- Logging — sending container stdout/stderr to CloudWatch
- Rolling deployments — updating to a new image version with zero downtime
Prerequisites
- A Docker image pushed to ECR (or Docker Hub)
- Basic understanding of Docker and AWS networking (VPC, subnets, security groups)
- AWS CLI configured with appropriate IAM permissions