By using AWS re:Post, you agree to the Terms of Use
/How to add EC2 to existing ECS cluster?/

How to add EC2 to existing ECS cluster?


Hi there,

I am trying to add an ec2 instance in to an ecs cluster, I tried to follow this guild , but i could not make it working.

here is my ec2 config:

    Type: AWS::EC2::Instance
      ImageId: ami-0d5564ca7e0b414a9
      InstanceType: g4dn.xlarge
      KeyName: tmp-key
      SubnetId: !Ref PrivateSubnetOne
      SecurityGroupIds: !Ref ContainerSecurityGroup
          !Sub |
          echo ECS_CLUSTER=traffic-data-cluster >> /etc/ecs/ecs.config
          echo ECS_ENABLED_GPU_SUPPORT=true >> /etc/ecs/ecs.config

Thank for your help

1 Answers
Accepted Answer


I think you have missed the IAM Roles to the Ec2, Please check the reference link Github

 - arn:aws:iam::aws:policy/service-role/AmazonEC2ContainerServiceforEC2Role
  - arn:aws:iam::aws:policy/service-role/AmazonEC2RoleforSSM
answered a month ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions