Skip to content

Instantly share code, notes, and snippets.

@dorancemc
Forked from cgswong/aws-cfn.sh
Last active May 6, 2018 06:52
Show Gist options
  • Save dorancemc/6d6cab59c86416732b14e572441bc71c to your computer and use it in GitHub Desktop.
Save dorancemc/6d6cab59c86416732b14e572441bc71c to your computer and use it in GitHub Desktop.
Setup CentOS server with AWS CFN bootstrap
#!/bin/bash
# Setup CentOS 7 host as AMI
# Update base OS update, and install EPEL repo and Python Pip
sudo yum -y update &&
sudo yum -y install epel-release &&
sudo yum -y install python-pip &&
# Install Python add-ons:
sudo pip install pystache &&
sudo pip install argparse &&
sudo pip install python-daemon &&
sudo pip install requests &&
# Install CFN-BootStrap from source
curl -sSL https://s3.amazonaws.com/cloudformation-examples/aws-cfn-bootstrap-latest.tar.gz | sudo tar -xpf -C - /opt
cd /opt/aws-cfn-bootstrap-1.4/
sudo python setup.py build
sudo python setup.py install
# Configure CFN
sudo ln -s /usr/init/redhat/cfn-hup /etc/init.d/cfn-hup
sudo chmod 775 /usr/init/redhat/cfn-hup
cd /opt
sudo mkdir aws
cd aws
sudo mkdir bin
ln -s /usr/bin/cfn-hup /opt/aws/bin/cfn-hup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment