Intro
- AWS managed container orchestration platform
- Integrates with ALB for load balancing to ECS tasks
- EFS is used as persistent multi-AZ shared storage for ECS tasks
- It doesn't automatically handle resource provisioning, balancing load, auto-scaling, monitoring, and placing your containers across your cluster. Use Elastic Beanstalk for that.
Launch Types
EC2 Launch Type
- Not Serverless
- Containers run on underlying EC2 instances
- ECS takes care of launching & stopping containers (ECS tasks)
- You must provision & maintain EC2 instances (use ASG)
- EC2 instances have ECS agent running on them as a docker container
- Inside a VPC spanning multiple AZ, there is an ECS cluster spanning multiple AZ. Inside the ECS cluster, there will be an ASG responsible for launching container instances (EC2). On every EC2 instance, ECS agent will be running (happens automatically if you choose the AMI for ECS when launching the instance) which registers these instances to the ECS cluster. This will allow the ECS cluster to run Docker containers (ECS tasks) on these instances.
<aside>
💡 The ECS configuration is present in the /etc/ecs/ecs.config
file in the EC2 instances. To modify properties such as the ECS cluster to which this instance should attach to, modify this file in the instance or in the user data of ASG.
</aside>
Fargate Launch Type