liveBook · Manning

ECS

As explained in Amazon Web Services in Action, Third Edition: An in-depth guide to AWS

Amazon ECS is a managed AWS service for deploying and running containerized applications.

Amazon Elastic Container Service (ECS) is a managed AWS service for deploying and running containerized applications. It orchestrates containers through clusters, task definitions, tasks, and services. section 18.0 section 18.6

Build an ECS deployment from four cooperating components:

  • Cluster: a logical group that isolates workloads, such as test and production environments. section 18.3
  • Task definition: the container image, CPU and memory limits, environment variables, and network configuration; it can describe one or multiple containers. section 18.3
  • Task: a running instance created from a task definition, with all its containers sharing the same host. section 18.3
  • Service: maintains multiple tasks, replaces failed tasks, spreads them across availability zones, scales capacity, and orchestrates rolling updates. section 18.3

Fargate supplies managed compute capacity, so container deployments do not require maintaining EC2 instances. A typical web architecture places an Application Load Balancer before an ECS service, while S3 stores application data. ECS integrates broadly with AWS and supports CloudFormation, but App Runner offers greater simplicity and fewer capabilities. section 18.5 section 18.6

Deploying a web application

A Notea deployment uses CloudFormation to create an ECS cluster, task definition, Fargate-backed service, load balancer, and S3 storage. The service starts two tasks, connects the application to the load balancer, and can scale the desired task count from two to four according to CPU utilization. Create the stack with the AWS CLI, wait for completion, then retrieve its output URL. section 18.5

Figure 18.3 A task definition defines all the details needed to create a task, which consists of one or multiple containers.

Use the task-definition diagram to inspect how container configuration becomes a running ECS task. section 18.3

How Amazon Web Services in Action, Third Edition: An in-depth guide to AWS covers it

How deep it goes
Explains clusters, task definitions, tasks, services, scaling, and Fargate, while deferring Docker image and container fundamentals.
Examples
Demonstrates a React and Next.js note-taking application using ECS, Fargate, an Application Load Balancer, S3, and CloudFormation.
What it assumes
Assumes basic container operation, S3 storage, and request distribution, while introducing ECS-specific terminology from the beginning.
What you can do after
Operate/configure ECS deployments with CloudFormation and the AWS CLI, including services, load balancing, and CPU-based autoscaling.
How it connects
Connects ECS with Fargate, Application Load Balancer, S3, CloudFormation, EKS, and Auto Scaling groups.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Amazon Web Services in Action, Third Edition: An in-depth guide to AWS. The section links point to the parts of the book it draws on.