In this part we cover how to save a custom AMI instance to our Amazon S3 Storage. Then we tie a new custom AMI to that image. We end up with our own saved AMI image we can spin up later on demand. You will need to spin up and complete the customization steps from the Part Three video if you are continuing our tutorial series. Otherwise this is a good video simply on how to save a custom linux AMI image for later use.
The tools and sites mentioned are:
You will run up storage costs by storing an image like this. I am not legally nor financially responsible for your use or how you use these tutorials. Please only do things you are legally and financially authorized for. It is on you.
Read More to get the list of commands used in this video.
scp -i DNAWorker.pem ~/Downloads/pk-STRINGOFTHIRTYTWOLETTERSORDIGITS.pem ~/Downloads/cert-STRINGOFTHIRTYTWOLETTERSORDIGITS.pem ubuntu@[your_instance_public_address]:~
>>ssh into instance
sudo cp *.pem /mnt
shred -u -n 1 *.pem
sudo apt-get install zip unzip ruby openssl libopenssl-ruby curl
sudo passwd root
curl http://s3.amazonaws.com/ec2-downloads/ec2-ami-tools.zip > ec2-ami-tools.zip
cp ec2-ami-tools.zip ec2
ln -s ec2-ami-tools-* current
>> add to bash
>> reinitialize config
ec2-bundle-vol -d /mnt -k /mnt/pk-STRINGOFTHIRTYTWOLETTERSORDIGITS.pem -c /mnt/cert-STRINGOFTHIRTYTWOLETTERSORDIGITS.pem -u XXXXXXXXXXXX
ec2-upload-bundle -b [your-s3-bucket] -m /mnt/image.manifest.xml -a [aws-access-key-id] -s [aws-secret-access-key]