I'm trying to set up a service that launches 20 single-container tasks with an application load balancer. The problem is that every task stays stuck on PROVISIONING

The service has logged an error saying that "service service_name is unable to consistently start tasks successfully", which does not seem very helpful since the documentation basically explains that the task launch failed and there were many retries.

My cluster is using an AutoScaleGroup capacity provider whose launch template is using an ecs-enabled AMI, with a role that has AmazonEC2ContainerServiceforEC2Role policy attached to it. The instance type is t2.micro (tried t2.small with no results)

Can anybody help me troubleshoot this situation? May the task definition be a cause for this? Thanks in advance

1

2 Answers

At the end, I realized that each task must have an HTTP endpoint called /health that should return 200. By calling that endpoint, the load balancer determines whether the container is PROVISIONING or READY

2

So, you need an IAM role attached policy ecsInstanceRole to the LC to register the instance to the ecs cluster AND set the userdata to:

#!/bin/bash echo ECS_CLUSTER=YOU_CLUSTER_NAME_HERE >> /etc/ecs/ecs.config 

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy