EC2 instance is not registered in ECS cluster


I created an ECS cluster for EC2 Linux + Networking, spot instance from web UI wizard. However, the instances never appear on the UI. I double-checked roles and policies, and I believe every permission is granted.

In the instances, I found an error in the cloud-init log file /var/log/cloud-init-output.log saying:

/var/lib/cloud/instance/scripts/part-001: line 7: /etc/init/spot-instance-termination-notice-handler.conf: No such file or directory

The auto-generated user data is:

echo ECS_CLUSTER=my-cluster >> /etc/ecs/ecs.config;echo ECS_BACKEND_HOST= >> /etc/ecs/ecs.config;
export PATH=/usr/local/bin:$PATH
yum -y install jq
yum install -y awscli
aws configure set default.region ap-northeast-1
cat <<EOF > /etc/init/spot-instance-termination-notice-handler.conf

I didn't modify the script and apparently, there is no such directory /etc/init in the latest AMI (amzn2-ami-ecs-gpu-hvm-2.0.20220831-x86_64-ebs)

asked 3 months ago25 views
No Answers

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