DVA-C03

Introduction to Amazon ECS, Amazon ECR and AWS Fargate

Run and store Docker containers on AWS.

  • 3 lessons
  • 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

Running Containers with Amazon ECS, Amazon ECR and AWS Fargate explains task definitions and services, the two IAM roles and the launch types. Building, Tagging and Managing Container Images in Amazon ECR explains Dockerfiles, pushing images from a pipeline, tags and immutability, lifecycle policies and scanning. Deploying New Versions to Amazon ECS Services Safely explains rolling updates, the deployment circuit breaker and the built-in blue/green, linear and canary strategies.

  1. Running Containers with Amazon ECS, Amazon ECR and AWS Fargate Lesson 1
  2. Building, Tagging and Managing Container Images in Amazon ECR Lesson 2
  3. Deploying New Versions to Amazon ECS Services Safely Lesson 3
  4. Practise and review
  5. Checkpoint Practice activities across the module
  6. Test your knowledge 10 questions