Elastic Container Service (ECS)

fully-manager container orchestration service. Highly secure, reliable, and scalable way to run containers

Components of ECS

Cluster

Multiple EC2 instances which will house the docker containers

Task Definition

A JSON file that defines the configuration of (upto 10) containers you want to run

Task

Launches containers defined in Task Definition. Tasks do not remain running once the workload is complete

Service

Ensures tasks remain running e.g. web-app

Container Agent

Binary on each EC2 instance whcih monitors, starts and stops tasks


Creating an ECS Cluster

  • Use Spot or On Demand
  • EC2 Instance Type
  • Number of Instances
  • EBS Storage volume
  • EC2 can be Amazon Linux 2 or Amazon Linux 1
  • Choose an VPC or create a new VPC
  • Assign an IAM Role
  • Option to turn on CloudWatch Container Insights
  • Choose a Key / Pair

Task Definition JSON File Example

[[elastic_container_service]]