Micro Series: What is AWS ECS?
AWS ECS (Elastic Container Service) is a managed service for running and orchestrating containers on AWS. You define your application’s containers in an ECS task definition, which describes things like the Docker images, CPU, memory, networking, environment variables, and ports. A single task definition can contain one or multiple containers. When ECS launches that definition, it creates a task, which is the actual running unit containing those containers. You can run tasks using Fargate, where AWS manages the underlying servers, or EC2, where you manage the underlying instances.
The main building blocks of ECS are clusters, task definitions, tasks, containers, and services. A task definition is the blueprint that describes how one or more containers should run, including their Docker images, CPU, memory, networking, ports, and other configuration.
A task is a running instance of that task definition, and it can contain one or multiple containers. An ECS service manages a desired number of tasks, ensuring they stay running and replacing failed tasks when necessary. For example, you could create a task definition containing a Node.js API container and a logging container, then configure an ECS service to maintain 3 tasks. With Fargate, AWS runs those tasks without you having to manage the underlying servers.