1

No Container Instances were found in your capacity provider

I want to use an autoscaling group as capacity provider for a ECS Cluster. Even tho I just want one container per container instance I chose the awsvpc as the network mode of my task definition. In other templates I create the autoscaling group with a launch template (in private subnets with NAT), a load balancer and a target group.

  • I chose 'ip' as target type in TargetGroup because of the awsvpc mode in my task definition,

  • of course, target group is NOT associated with my autoscaling group,

  • I'm using an ECS-optimized AMI,

  • I haven't added userdata to my launch template

Still, when I try to create my service in the cluster an error shows: 'No Container Instances were found in your capacity provider'

What could it be? I'm not sure if it. was to do with policies, roles and stuff

I've read that some people may add userdata to the launch template but I'm not sure that's a solution for me. I want an autoscaling group as a capacity provider, not a single server.

  • You need to check the ECS cluster to see if it shows any registered EC2 instances, I'm assuming it doesn't. You need to check the auto-scaling group to see if it has scaled out to create any instances. Next, if there are EC2 instances then you need to check the ECS agent log on that instance or instances to see if there is any sort of error message. The most common issue is that you didn't give the EC2 instance's security group access to register with the ECS cluster, or you placed them in a private subnet without access to the ECS API. – Mark B Jul 19 '23 at 12:48

0 Answers0