ECS (Elastic Container Service)
💡 Definition
Amazon ECS is a highly scalable, high-performance container orchestration service that supports Docker containers and allows you to easily run and scale containerized applications on AWS.
🔑 Key Concepts
- Container: A lightweight, portable, and self-sufficient executable package that includes an application and its dependencies. Docker is a popular container technology.
- Task Definition: A blueprint for your application, specifying the Docker image, CPU, memory, and networking requirements.
- Service: Defines how many copies of your task definition should run and how they should be maintained.
- Cluster: A logical grouping of EC2 instances (if using EC2 launch type) or simply a logical grouping for Fargate tasks.
- Launch Types:
⚙️ How it Works
- Define Task: Specify container image, resources, ports.
- Create Service: Define desired number of tasks, networking, load balancing.
- Launch: ECS places and runs your containers based on the chosen launch type (EC2 or Fargate).
🎯 Use Cases
- Microservices: Running independent services that make up a larger application.
- Batch Processing: Running scheduled or on-demand containerized jobs.
- Web Applications: Hosting scalable web applications.
💰 Pricing Model
- ECS Control Plane: Free.
- EC2 Launch Type: You pay for the underlying EC2 instances.
- Fargate Launch Type: Pay for the vCPU and memory resources your containers consume from the time you start downloading the Docker image until the task terminates.
📝 Exam Tips (CLF-C02)
- ECS is AWS's proprietary container orchestration service.
- It supports Docker containers.
- Understand the difference between EC2 launch type (you manage servers) and Fargate launch type (serverless containers).
- Often compared with EKS (managed Kubernetes).