AWS ECS Error when running task: No Container Instances were found in your cluster

后端 未结 10 1649
时光说笑
时光说笑 2020-11-28 04:02

Im trying to deploy a docker container image to AWS using ECS, but the EC2 instance is not being created. I have scoured the internet

10条回答
  •  春和景丽
    2020-11-28 04:20

    I figured this out after a few more hours of investigating. Amazon, if you are listening, you should state this somewhere in your management console when creating a cluster or adding instances to the cluster:

    "Before you can add ECS instances to a cluster you must first go to the EC2 Management Console and create ecs-optimized instances with an IAM role that has the AmazonEC2ContainerServiceforEC2Role policy attached"

    Here is the rigmarole:

    1. Go to your EC2 Dashboard, and click the Launch Instance button.

    2. Under Community AMIs, Search for ecs-optimized, and select the one that best fits your project needs. Any will work. Click next.

    3. When you get to Configure Instance Details, click on the create new IAM role link and create a new role called ecsInstanceRole.

    4. Attach the AmazonEC2ContainerServiceforEC2Role policy to that role.

    5. Then, finish configuring your ECS Instance.
    NOTE: If you are creating a web server you will want to create a securityGroup to allow access to port 80.

    After a few minutes, when the instance is initialized and running you can refresh the ECS Instances tab you are trying to add instances too.

提交回复
热议问题