1 Answer
- Newest
- Most votes
- Most comments
0
the error is happening because the /etc/init directory does not exist in ec2. add a mkdir /etc/init before the cat <<EOF > in your userdata.
#!/bin/bash
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
**mkdir /etc/init**
cat <<EOF > /etc/init/spot-instance-termination-notice-handler.conf
answered 2 years ago
Relevant content
- asked 5 months ago
- AWS OFFICIALUpdated 7 months ago
- AWS OFFICIALUpdated 7 months ago
- AWS OFFICIALUpdated a month ago