AWS machine Image (AMI)

Posted under » AWS on 4 April 2022

Restoring an AMI

This could be a lifesaver if you accidently screwed up your EC2. It is important that before you do anything major like an OS update, that you make an image or snapshot of your EC2 first which acts as a backup.

Do use your backup AMI, you go to > Actions > Monitor and troubleshoot. Then go to "Replace root volume". You will see 3 options. I am not sure what it means by "Launch state" but the other 2 are the better option. They are

Snaphot
Image

They will ask for Snapshot ID or AMI ID and you will be taken back to the state it once was.

Migrating an AMI

To migrate an EC2 instance to another AWS account is surprisingly a complex process. I initially assume you just need to stop your instance and then move them to a new home but there is no such option.

AWS requires us to create an AMI first. I tried to directly create one but was faced with a "Volumes size for volumes must be between and". This is an error in the error text itself!

I just did not declare most things but just the name (Lion) and description of the AMI. It worked and I was able to create an image.

It is still a private image but I need to share this AMI to another account. So I share it using the other AWS account ID. When I go to the other account, I go to the EC2 AMI panel. I look for the AMI under private images and I saw it (Lion) there.

I was then able to launch the EC2 after making the SSD size larger than what I had before. You cannot fit big into small but the reverse is true.

web security linux ubuntu python django git Raspberry apache mysql php drupal cake javascript css AWS data