Introduction to Amazon ECS, Amazon ECR and AWS Fargate
Run and store Docker containers on AWS.
- 1 lesson
- Module quiz
A container packages an application with everything it needs to run, such as its runtime and libraries, so it behaves the same on a laptop and in production. Running containers in production requires a registry to store images, an orchestrator that starts, restarts, scales and replaces containers, and compute for them to run on.
AWS provides each of these. Amazon Elastic Container Registry (Amazon ECR) stores container images. Amazon Elastic Container Service (Amazon ECS) is AWS's container orchestrator: it runs containers as tasks, described by task definitions, and keeps services running at the desired count behind load balancers. AWS Fargate is serverless compute for containers, so ECS tasks can run without managing any EC2 instances. ECS itself is free; the EC2 or Fargate capacity is charged, and ECR is charged for storage and data transfer.
Where these services fit
Containers suit workloads that do not fit Lambda, such as long-running services or applications already packaged as images. The exam tests building and pushing images to ECR, choosing between Fargate and EC2 capacity, and, most often, the difference between the task role, which grants permissions to the application, and the task execution role, which ECS uses to pull images and write logs.
How this module is organised
The module has a single lesson, Running Containers with Amazon ECS, Amazon ECR and AWS Fargate, which explains images and ECR, task definitions and services, the two IAM roles, launch types and deployments.