Is there a way to use a launch template or auto scaling group previously created by aws ecs, eks?

0

I use ecs and eks, but if I create autoscaling and launch template while creating ecs and eks, ecs and eks services and node groups worked normally.

However, when using the previously created autoscaling group and start template, I don't know why, but I couldn't recognize it, so I couldn't properly create a task in ecs or a nodegroup in eks.

I tried adding and changing various options by creating eks with terraform, but I couldn't figure it out.

Is there a way to create one using an existing autoscaling or launch template within aws ecs, eks in console or terraform?

1 Answer
1

Hello Alice,

Could you please check the following troubleshooting steps for ECS and let me know if these help you?

  1. Please make sure you have allocated an IAM role to your launch template. Check the documentation for the IAM role here
  2. Please make sure you are using ECS optimised AMI or have the required tooling installed in your AMI.
  3. Please make sure that the autoscaling group you have previously created has "maximum" instance configured for the group to be greater than 0.
  4. Please make sure the instances have either public IP or route to NAT gateway or VPC endpoint so that they can contact Amazon ECS service endpoint.
  5. . If you have more than 1 cluster in your region, please make sure in your launch template you have the following user data configured:
#!/bin/bash
echo ECS_CLUSTER=your_cluster_name >> /etc/ecs/ecs.config

This documentation here contains all of the above steps with a few more that are needed to configure EC2 instances in ECS, please have a look in case the above top 5 suspects does not work for you.

To troubleshoot further, you could also look login to your instance and check the logs under /var/log/ecs/ecs-agent/*

Thanks, Manish

profile picture
Manish
answered a year 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