Skip to content

Instantly share code, notes, and snippets.

@jwchang0206
Last active December 14, 2015 21:19
Show Gist options
  • Save jwchang0206/5150362 to your computer and use it in GitHub Desktop.
Save jwchang0206/5150362 to your computer and use it in GitHub Desktop.
nano /mnt/pk.pem
export EC2_PRIVATE_KEY=/mnt/pk.pem
export EC2_CERT=/mnt/cert.pem
ec2-bundle-vol -d /mnt -k $EC2_PRIVATE_KEY -c $EC2_CERT -u YOUR-AWS-ACCOUNT-NO -r x86_64
perl -pi -e 's%(universe)$%$1 multiverse%' /etc/apt/sources.list
apt-get update
apt-get install ec2-ami-tools ec2-api-tools
ec2-register -K $EC2_PRIVATE_KEY -C $EC2_CERT BUCKET/image.manifest.xml
ssh -i ~/myKeyPair.pem ubuntu@ec2-54-248-14-137.ap-northeast-1.compute.amazonaws.com
ec2-upload-bundle -b BUCKET -m /mnt/image.manifest.xml -a YOUR-AWS-ACCESS-ID -s YOUR-AWS-ACCESS-KEY
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment