amazon-ec2aws-opsworksaws-ecs

AWS ECS: Will Service Auto Scaling create EC2 instance automately?


I am confused about how Service AutoScaling automately works. Will it create EC2 instance automately? I create it and add it to a Cluster's service, but it does no create EC2 for placing my required number of tasks. Is any thing wrong with my settings? I check the [Events] and see "service s2 was unable to place a task because no container instance met all of its requirements. ", but shouldn't it create a EC2 if no instance met? Please give me some advice, thanks in advance.


Solution

  • but shouldn't it create a EC2 if no instance met

    Not really. There are two types of scaling policies: scaling policies on an ECS service and scaling policies on the ECS cluster. Instances are added based on cluster scaling policies, and that's what you should set up in addition to your service scaling policy.

    AWS has a couple of detailed tutorials on scaling ECS clusters: https://aws.amazon.com/blogs/compute/automatic-scaling-with-amazon-ecs/ https://docs.aws.amazon.com/AmazonECS/latest/developerguide/cloudwatch_alarm_autoscaling.html