AWS Ecs Task run error Unable to run task No container instances were found in your cluster

Viewed 392

I have completed below steps to create ECS Cluster and task in AWS Console

1) Created image and pushed to ECR. The image is based on Node.js and it uses http server to displays a static message, listens on port 3000. It does not use any of the other AWS services.

2) Created VPC network with 2 public subnets along with iGW and private subnets

3) Created NAT Gateway in public subnet and associated with the two private subnets using route table association

4) Created Security group with destination of VPC cidr block

5) Created Cluster with 2 EC2 instances using ECS Console, this is created successfully. Auto scaling group is also created successfully.

6) Created Task definition using ECS Console, selected the two private subnets, Network mode as “awsvpc”

7) Currently I am not using any load balancer

I just wanted to test the task before creating the service When I run the task , I get an error “Unable to run task No container instances were found in your cluster”

I verified following 1) EC2 – 2 Instances created successfully, with IAM role as ecsinstanceRole

2) User data for ec2 instance shows proper cluster name

3) The image works locally

0 Answers
Related