Reputation: 13041
I am trying to provision an ECS Cluster using CloudFormation. The basic context is:
yum
.This works but for some reason it is quite slow. It seems that the Amazon ECS–optimized AMI comes with its own scripts that install software with yum and that the yum from my UserData script is blocked by that and needs to wait until it can install additional packages.
Is there a recommended way on how to install additional packages when using the ECS-Enhanced AMI?
I currently use a simple script:
#!/bin/bash
yum update -y
yum install -y nfs-utils
Upvotes: 0
Views: 416
Reputation: 6329
I have almost the same setup but I use CloudInit instead of a simple script as UserData. I suggest you do the same considering I didn't experience any particular slowness when launching an instance.
#cloud-config
repo_upgrade: all
write_files:
- path: /root/init.sh
owner: root:root
permissions: '0755'
content: |
#!/bin/bash
set -e
# ECS optimized instances are bare bones and we need to install a few packages
yum install -y aws-cli wget gettext python-pip
...
cloud_final_modules:
- runcmd
- scripts-user
runcmd:
- /root/init.sh
Upvotes: 1