ECS

- used to run Docker containers and has 3 flavors:
- ECS "Classic": provision EC2 instances to run containers
- Fargate: ECS serverless, no need to provision EC2
- EKS: managed Kubernetes by AWS
ECS Clusters
- logical grouping of EC2 instances
- EC2 instances run the ECS agent (Docker container)
- The ECS agents registers the instance to the ECS cluster
- The ECS instances run a special AMI, made specifically for ECS
- EC2 instances must enable config
ECS_ENABLE_TASK_IAM_ROLE
in /etc/ecs/ecs.config
file (automatically setup by ECS)
ECS Task Definitions
- Tasks definitions are metadata in JSON form to tell ECS how to run a Docker Container
- Information about:
- Image Name
- Port Binding for Container and Host
- Memory and CPU required
- Environment variables
- Networking information
EC2 Service
- ECS Services help define how many tasks should run and how they should be run
- ensure that the number of tasks desired is running across our fleet of EC2 instances
- can be linked to ELB / NLB / ALB
ECS Service with Load Balancer
- must not specify a host port (only container port)
- use ALB with dynamic port mapping