Skip to content

Instantly share code, notes, and snippets.

@codeinthehole
Created August 1, 2014 14:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codeinthehole/588154f10899eb5dadb7 to your computer and use it in GitHub Desktop.
Save codeinthehole/588154f10899eb5dadb7 to your computer and use it in GitHub Desktop.
Minimal "user-data" for an AWS EC2 instance
#!/bin/bash
BUCKET=tangent-boilerplate
# Install AWS CLI
apt-get update
apt-get install -y python-pip
pip install awscli
# Fetch and run bootstrap file. For this to work, the EC2 instance needs to have an IAM role
# that allows read access to S3.
BOOTSTRAP_SCRIPT=/tmp/bootstrap.sh
aws s3 cp s3://$BUCKET/bootstrap/webserver.sh $BOOTSTRAP_SCRIPT
chmod +x $BOOTSTRAP_SCRIPT
$BOOTSTRAP_SCRIPT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment