aws/amazon-ecs-cli

InvalidParameterException: No Container Instances were found in your cluster.

ccrvlh opened this issue · 1 comments

Summary

While following the tutorial to use the ecs-cli to create a cluster and tasks using the compose I got an error while doing ecs-cli compose up: it says "InvalidParameterException: No Container Instances were found in your cluster." No EC2 Instances were create. I can see an empty cluster, I can't see any EC2 instance (tested a few other regions as well, and nothing shows).

Description

This is a recently created cluster, created following the tutorial with the following command:

ecs-cli compose up \
    --cluster-config myconfig \
    --ecs-profile myprofile

The command right before the compose up

ecs-cli up \
    --keypair mykey \
    --capability-iam \
    --size 2 \
    --instance-type t4g.micro \
    --cluster-config myconfig \
    --ecs-profile myprofile \
    --security-group sg-xxxxxxx \
    --vpc vpc-xxxxxxx \
    --region us-east-1 \
    --subnets subnet-xxxxxxx \
    --verbose

My key is active and can be seen in the EC2 console.
myconfig was recently created (in the step before this command)
myprofile was recently created (in the step before this command)
security-group was recently created, it has access to 80 HTTP and 443 HTTPS from anywhere and 22 SSH from my IP
VPC is the default VPC
subnet is the default with 0.0.0.0/0destination targeting the default internet-gateway

The command order was:
> ecs-cliecs-cli configure --cluster mycluster --default-launch-type EC2 --config-name myconfig --region us-east-1
> ecs-cli configure profile --access-key xxx --secret-key xxx --profile-name omieshop-profile
> ecs-cli up .......
> ecs-cli compose up

Profile and access key have full access permission.
aws ecs list-container-instances --cluster mycluster is also empty.

Versions

ECS-CLI Verison: ecs-cli version 1.21.0 (bb0b8f0)
Go Version: go version go1.15.6 darwin/amd64
Platform: macOS High Sierra

Output

The full output is:

INFO[0002] Using ECS task definition                     TaskDefinition="backend:9"
INFO[0002] Auto-enabling ECS Managed Tags               
ERRO[0002] Error running tasks                           error="InvalidParameterException: No Container Instances were found in your cluster." task definition=0xc0002f24e0
FATA[0002] InvalidParameterException: No Container Instances were found in your cluster. 

Found that is was probably a problem with the instance type, it says that t4g.micro is not supported for some reason. When I tried with t3a.micro it worked just fine. Maybe worth updating the message (having a check if the instances were correctly created - since the ecs-cli didn't point any errors, even though there were no instances), and the documentation as well.