Copy AWS EC2 AMI To Other AWS Account Same Region and Other Region

Copy AWS EC2 AMI To Other AWS Account Same Region and Other Region

What IS AMI

Its Amazon Machine Image...

An Amazon Machine Image (AMI) provides the information required to launch an instance. You must specify an AMI when you launch an instance. You can launch multiple instances from a single AMI when you need multiple instances with the same configuration. You can use different AMIs to launch instances when you need instances with different configurations.

  1. Make AMI from EC2
  • Here i am going to explain how to Share AMI to one AWS Account to other Account. Also explain copy the AMI one AWS Region to other Region.

If You want to learn about how to create AMI from EC2. Check My previous article

  • We are taking the below webserver image as AMI. See the servers public IP.

image.png

  • We will check this ip in browser.it shows my portfolio site running in this server. image.png
  • I am going to take this server as AMI.

image.png

  • This is that webserver AMI.
  • Now the AMI is available

image.png

  • Now we have the AMI in ap-south-1(Mumbai/India) Region.

2.Share the AMI to other Account

  • This is My Source AWS Account. image.png
  • This Is My Destination account

image.png

  • We Will share the AMI to one of my other account. image.png

  • Click add permission and save.

image.png

  • That's all we have shared the AMI to other AWS Account.

3.Launch the EC2 Instance from Shared AMI Image

  • Now we want to login to the Other AWS Account. which account we will share the AMI.
  • In this account EC2 AMI console we can see the shared AMI image here.

image.png

  • Ok,Now we will going to launch the EC2 instacne from the shared AMI.With default values.

One important thing is AMI attached with SOurce account .pem Keyfile Thats the only key file we will used to connect the instance.in this instance launch configuration we will attach our pem key file.thats not useful.

  • I Have launched the instance. We will check the instance ip in browser to check the web server content worked after shared the AMI.

image.png

image.png

  • Yeah Its Working perfectly.

4.Copy AMI One region to other Region.

  • Here i am going to explain how to copy the AMI one region to other region in the same account.
  • First select the AMI which one want to be copy.and going to action choose the copy AMI option.

image.png

  • There its shows which region you want to copy the AMI.

image.png

  • Currently iam in ap-south-1 (mumbai/India) region.i will copy my AMI to US-East-1 Region.

image.png

  • Now I will Going to check the US-East-1 Region.

image.png

Yes .its copied the AMI in this region.

That's all Guys.

Did you find this article valuable?

Support Venketraman by becoming a sponsor. Any amount is appreciated!