How to add EC2 to existing ECS cluster?
0
Hi there,
I am trying to add an ec2 instance in to an ecs cluster, I tried to follow this guild https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_container_instance.html , but i could not make it working.
here is my ec2 config:
EC2:
Type: AWS::EC2::Instance
Properties:
ImageId: ami-0d5564ca7e0b414a9
InstanceType: g4dn.xlarge
KeyName: tmp-key
SubnetId: !Ref PrivateSubnetOne
SecurityGroupIds: !Ref ContainerSecurityGroup
UserData:
Fn::Base64:
!Sub |
#!/bin/bash
echo ECS_CLUSTER=traffic-data-cluster >> /etc/ecs/ecs.config
echo ECS_ENABLED_GPU_SUPPORT=true >> /etc/ecs/ecs.config
Thank for your help
asked a month ago5 views
1 Answers
1
Accepted Answer
Hello
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
Relevant questions
Should ECS/EC2 ASGProvider Capacity Provider be able to scale-up from zero, 0->1
Accepted Answerasked 5 months agoHow to add availability zone to existing kafka cluster without downtime?
Accepted Answerasked 4 months agoECS Container not recognizing EC2 instances after updating AMI
asked 3 years agoEnable awsvpctrunking at container instance level
asked 3 years agoSending UDP traffic to EC2 host from ECS instance, security group issue on EC2 host
asked 2 months agoUpgrade ecs-agent on Windows 2016 ECS Optimized AM
asked 2 years agoMove dockerized Jenkins server to AWS
Accepted Answerasked 3 years agoECS: Random container failed to start - no log
asked 7 days agoHow to add EC2 to existing ECS cluster?
Accepted Answerasked a month agoUnable to configure Multi AZ deployment for existing Aurora MySQL
Accepted Answerasked 2 months ago