How to scale in/out EC2 instances based on ECS cluster resources availability?
问题 I have multiple services running in my ECS cluster. Each service contains one or more tasks based on CPU utilization or a number of users. I have deployed these containers with EC2 launch type. Now, I want to increase/decrease the number of EC2 instances based on available resources in the cluster. Let's say there are four ECS tasks running in two m5.large instances. Now, if an ECS service increases the number of tasks and there aren't enough resources available in the cluster, how can I spin