I have created an ECS cluster linked to an Autoscaling group with an Application load balancer attached. The Autoscaling deploys the instances, the AMI is correctly choosen (ECS optimized).
for whatever reason the ecs instances are being deployed by the Auto Scaling service but are not registering with the ECS Cluster.
Does anybody have an idea, what could cause the error of not having the instances on my cluster?
Best Answer
Your EC2 instances just don't have enough permissions to register with ECS cluster:
Check IAM role that you've assigned to your EC2 instances. It should include appropriate permissions, for example:
Or you can use AWS-managed policy named
AmazonEC2ContainerServiceforEC2Role
and assigned it to your EC2 role.More information is avalable at https://docs.aws.amazon.com/AmazonECS/latest/developerguide/instance_IAM_role.html.