I have created an ECS cluster, and deployed a 2-container task using a Service (during Service create I associate the Application Load Balancer – using target group of type IP – to it),
this works fine (I can access my DNS URL and it loads as expected).
I am now trying to use an AutoScalingGroup for automatically scaling instances (cluster autoscaling), based on CPU utilization.
I have created the ASG (desired instance count=1, max=4), but now need to create a dynamic scaling policy, based on CPU utilization.
If average instance CPU usage is over 50%, I want the ASG to add more instances using simple scaling.
(and if ave usage falls under 40, scale back in to min desired count again).
I have added (to my ASG) > dynamic scaling policy (type=simple, scale out 1 instance if alarm triggered)
Cloudwatch Alarm=using ClusterName, ServiceName, CPUutilization > 50%, based on previous post.
The alarm goes into In Alarm state and instances are being added by the ASG (desired capacity=1, max=4):
However, no new tasks are being launched on the cluster (it remains at 1, and my app remains unresponsive):
My cluster’s instances also remains at 1 (It is as if the newly created ones by the ASG are not being registered to the cluster):
How to get the cluster to recognize (and use) the newly created instances?