You will need to place your private key and X.509 certificate where they can be downloaded. For the sake of simplicity, the example script retrieves the credentials using wget protected by a username and password. In practice, I would use sftp or scp to transfer the credentials
UPDATE 1/14/11: The script from 1/13/11 contained errors and has been replaced. The current script has been tested against ami-cef405a7
UPDATE 1/14/11: The script from 1/13/11 contained errors and has been replaced. The current script has been tested against ami-cef405a7
#!/bin/bash -ex
exec > >(tee /var/log/user-data.log|logger -t user-data -s 2>/dev/console) 2>&1
# download the install script and run it
cd /home/ubuntu
# grab your private key and X.509 cert
wget --user=user --password='myPassword' http://example.server.com/home/*.pem
sudo chmod 600 *pem
# change this to your keypair and cert
export EC2_PRIVATE_KEY=~/myKey.pem
export EC2_CERT=~/myCert.pem
# get install script
wget http://dl.dropbox.com/u/6706687/postgres-ubuntu-ec2-install.sh
chmod 755 postgres-ubuntu-ec2-install.sh
# run it, note that the install script now takes arguments for the number of volumes
# and the size of each volume in gigbytes, args below create a 500GB RAID10
sudo -u ubuntu ./postgres-ubuntu-ec2-install.sh 10 100