Last active
August 29, 2015 14:13
-
-
Save goonoo/01d934801b75d60d52b1 to your computer and use it in GitHub Desktop.
EC2 Build Image script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| PATH=path/to/images | |
| IMAGE=Image-`date +%Y%m%d-%H%M` | |
| AWS_ACCESS_KEY=AGWEGAWEGAWEGAWEG | |
| AWS_SECRET_KEY=waWG#reH5452HE23raWy432% | |
| echo "building image ${IMAGE}" | |
| sudo ec2-bundle-vol -k /home/ubuntu/.ssh/id_rsa -c /home/ubuntu/keys/server.crt -u USER_ID -r x86_64 --no-filter | |
| ec2-upload-bundle -a ${AWS_ACCESS_KEY} -s ${AWS_SECRET_KEY} --bucket ${PATH}/${IMAGE} -m /tmp/image.manifest.xml | |
| ec2-register ${PATH}/${IMAGE}/image.manifest.xml -region ap-northeast-1 -O ${AWS_ACCESS_KEY} -W ${AWS_SECRET_KEY} -n $IMAGE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment