Servisphere
Amazon Elastic Container Service icon (AWS Architecture Icons)

Amazon Elastic Container Service

Container orchestration

AWS's service for running and managing many containers (tasks/services), automatically restarting them on failure and connecting them to load balancers.

  • Cost$$ Medium
  • Difficulty●●●●●
  • Costs money when idle?No
  • Managed by AWS
  • In examsSAA · DVA · SOA

Scope: Regional

Open ECS on the map →
Think of it asLike a logistics dispatcher loading cargo boxes (containers) onto the right trucks.

Where does ECS fit?

See the full map →

A real example, step by step

  1. Your team packages its API as a Docker image and pushes it to ECR.
  2. You write a task definition: which image, how much CPU and memory, which environment variables, where logs go.
  3. You create an ECS service that always keeps 3 tasks running behind an Application Load Balancer, using Fargate.
  4. If a task fails, ECS starts a new one; when you deploy a new version, ECS replaces tasks gradually so the site never goes down.
  5. When traffic grows, service auto scaling adds tasks based on CPU.

▶ Watch the “Container application” scenario on the map

When to use it

✓ Use it when

Running container apps without wanting to learn Kubernetes.

✗ Avoid it when

Your team already knows Kubernetes or needs multi-cloud → EKS.

Common uses

  • Containerized microservices behind an ALB
  • Background workers reading from SQS
  • Batch jobs running as containers
  • Bring Docker apps to AWS without learning Kubernetes

ECS, EKS or Fargate?

ECSEKSFargate
What it isAWS's container orchestratorStandard Kubernetes managed by AWSServerless compute for containers
Learning curveLow, few conceptsHigh, you need to know KubernetesLow, used with ECS or EKS
Separate feeNoneHourly control plane feevCPU and memory per task
Best forAWS-only teams that want simplicityTeams that know Kubernetes or run in several placesNot managing a cluster of machines

What does it cost?

ExampleA service with 2 Fargate tasks (0.5 vCPU, 1 GB) running 24/7 ≈ $36/month, plus an ALB ≈ $16+/month.
  • Pricing model: ECS itself is free. You pay for where tasks run: EC2 (per instance-hour) or Fargate (per vCPU and GB of memory).
  • Free tier: No ECS charge.
⚠️ Cost traps

Tasks pulling images through a NAT Gateway (use VPC endpoints for ECR and S3 to avoid this); a separate ALB per service; container logs with no retention period set.

Reference prices for us-east-1, updated October 14, 2026; they may have changed. Always check the AWS pricing page. Official AWS pricing page ↗

💡 Exam tip

The task role gives permissions to the application in the container (read S3, write DynamoDB); the task execution role lets ECS pull images from ECR and write logs. “No servers to manage” → choose the Fargate launch type.

Try real exam questions

AWS certification exams are in English, so the questions are shown as they appear on the exam.

1An ecommerce website is deploying its web application as Amazon Elastic Container Service (Amazon ECS) container instances behind an Application Load Balancer (ALB). During periods of high activity, the website slows down and availability is reduced. A solutions architect uses Amazon CloudWatch alarms to receive notifications whenever there is an availability issue so they can scale out resources. Company management wants a solution that automatically responds to such events. Which solution meets these requirements?

  1. ASet up AWS Auto Scaling to scale out the ECS service when there are timeouts on the ALB. Set up AWS Auto Scaling to scale out the ECS cluster when the CPU or memory reservation is too high.
  2. BSet up AWS Auto Scaling to scale out the ECS service when the ALB CPU utilization is too high. Set up AWS Auto Scaling to scale out the ECS cluster when the CPU or memory reservation is too high.
  3. CSet up AWS Auto Scaling to scale out the ECS service when the service's CPU utilization is too high. Set up AWS Auto Scaling to scale out the ECS cluster when the CPU or memory reservation is too high.
  4. DSet up AWS Auto Scaling to scale out the ECS service when the ALB target group CPU utilization is too high. Set up AWS Auto Scaling to scale out the ECS cluster when the CPU or memory reservation is too high.
Show answer

Correct answer: C

Scale the number of tasks in the ECS service on the service's own CPU, and scale the cluster's instances on CPU/memory reservation. An ALB has no CPU metric to base scaling on.

2A company is running a multi-tier web application on premises. The web application is containerized and runs on a number of Linux hosts connected to a PostgreSQL database that contains user records. The operational overhead of maintaining the infrastructure and capacity planning is limiting the company's growth. A solutions architect must improve the application's infrastructure. Which combination of actions should the solutions architect take to accomplish this? (Choose two.)

  1. AMigrate the PostgreSQL database to Amazon Aurora.
  2. BMigrate the web application to be hosted on Amazon EC2 instances.
  3. CSet up an Amazon CloudFront distribution for the web application content.
  4. DSet up Amazon ElastiCache between the web application and the PostgreSQL database.
  5. EMigrate the web application to be hosted on AWS Fargate with Amazon Elastic Container Service (Amazon ECS).
Show answer

Correct answer: A, E

Move the database to Aurora (a managed service) and run the containers on Fargate with ECS: no servers to operate and no capacity planning. Moving to EC2 still means managing machines yourself.

Practice 700+ more questions on Servisphere →

Frequently asked questions

Is it better to run ECS on Fargate or on EC2?

Fargate removes server management and charges for the CPU and memory of each task. Running on EC2 means managing a cluster of instances yourself, but you choose the instance types (including GPUs) and it is often cheaper for large, steady workloads.

Does ECS cost anything?

ECS has no separate charge. You pay for the resources that run your containers, either Fargate (vCPU and memory per second) or EC2 instances, plus any load balancers, logs and storage you use.

What do AWS exams ask about ECS?

Telling task definitions, tasks and services apart; the task role (permissions for your application) versus the execution role (permissions to pull images and write logs); choosing the Fargate or EC2 launch type; and integration with ALB, ECR and CloudWatch Logs.

Related services

Open ECS on the map →