Skip to content

Instantly share code, notes, and snippets.

@driedtoast
Created April 8, 2010 21:10
Show Gist options
  • Save driedtoast/360541 to your computer and use it in GitHub Desktop.
Save driedtoast/360541 to your computer and use it in GitHub Desktop.
#!/bin/sh
EC2_MODULE="2.6.21.7-2.fc8xen-ec2-v1.0" ## set the ec2 module
SCRIPT_DIR="/var/awsscripts" ## scripts to setup the amazon stuff, will be copied to the image
IMAGE_DIR="/var/awsimage" ## directory to store the img file and ami image in
RELEASEVER=11
ARCH=i386 # x86_64
IMAGE_SIZE=2560 ## set the image size
## amazon stuff
EC2_HOME=~/.ec2
AWS_USER=<Your account number >
AWS_ACCESS_KEY_ID=<Your access key>
AWS_SECRET_ACCESS_KEY=<Your secret access key>
EC2_PRIVATE_KEY=$EC2_HOME/pk-<Your private key name>.pem
EC2_CERT=$EC2_HOME/cert-<Your public key name>.pem
BUCKET_NAME=< s3 bucket name to store the image >
export EC2_HOME AWS_USER AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY EC2_PRIVATE_KEY EC2_CERT BUCKET_NAME
IMAGE_NAME=$1 ## passed in to the script
BASE_NAME="ami-fedora$RELEASEVER-$ARCH_$IMAGE_NAME"
IMG_FILE="$BASE_NAME.img"
echo "Image file is: $IMG_FILE"
echo "Base Name: $BASE_NAME"
if [ ! -d "$IMAGE_DIR" ]; then
mkdir $IMAGE_DIR
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment