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

后端 未结 10 1693
时光说笑
时光说笑 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:21

    When this happens, you need to look to the following:

    1. Your EC2 instances should have a role with AmazonEC2ContainerServiceforEC2Role managed policy attached to it
    2. Your EC2 Instances should be running AMI image which is ecs-optimized (you can check this in EC2 dashboard)
    3. Your VPC's private subnets don't have public IPs assigned, OR you do not have an interface VPC endpoint configured, OR you don't have NAT gateway set up

    Most of the time, this issue appears because of the misconfigured VPC. According to the Documentation:

    QUOTE: If you do not have an interface VPC endpoint configured and your container instances do not have public IP addresses, then they must use network address translation (NAT) to provide this access.

    • To create a VPC endpoint: Follow to the documentation here
    • To create a NAT gateway: Follow to the documentation here

    These are the reasons why you don't see the EC2 instances listed in the ECS dashboard.

提交回复
热议问题