Friday, November 25, 2011

Automate EC2 Instance Setup with user-data Scripts - Alestic.com

Automate EC2 Instance Setup with user-data Scripts - Alestic.com: "Here is a sample user-data script which sets up an Ubuntu LAMP server on a new EC2 instance:

#!/bin/bash
set -e -x
export DEBIAN_FRONTEND=noninteractive
apt-get update && apt-get upgrade -y
tasksel install lamp-server
echo "Please remember to set the MySQL root password!"
Save this to a file named, say, install-lamp and then pass it to a new EC2 instance, say, Ubuntu 9.04 Jaunty:

ec2-run-instances --key KEYPAIR --user-data-file install-lamp ami-bf5eb9d6
Please see http://alestic.com for the latest AMI ids for Ubuntu and Debian.

"

'via Blog this'