Monday, August 2, 2021

How to move an EC2 Instance to another AWS Account?

Introduction :

In this tutorial we will show you,move an EC2 Instance to another AWS Account with the help of AMI (Amazon Machine Image) service.

EC2 stand for (Amazon Elastic Compute Cloud) is a service of Amazon cloud-computing platform, Amazon Web Services, that allows users to rent virtual computers on which to run their own computer applications.

AMI stand for (Amazon Machine Image) It is a type of backup service for EC2 Instance, there we can create A virtual image of EC2, and it is specially use for re-launching the machine , storing image for backup purpose and sharing the image with another another account or region.


How to move an EC2 Instance to another AWS Account?


Prerequisite :

  • Keep the Destination AWS Account ID

Step 1) Login to the AWS Console

Step 2) Switch to the EC2 service

Step 3) Select the Instance which you want to take the AMI 

--> Go to Actions --> Image and Template --> Create Image


Step 4) Enter the Image name and description , Enable "No reboot" and Tag the instance

  • No reboot - Select No reboot to avoid having your instance shut down



Step 5)
After filling all the above details select "Create Image" button

Step 6) AMI will be created in few minutes, Go to AMI section and wait until AMI Available

Step 7) Select the AMI that needs to be shared. and go to 

--> Actions --> Modify Image Permissions

Step 8) Choose image type "Private" Update the Destination AWS account number, then click on Add Permission and choose "Add 'create volume' permissions" 



Step 9) To verify the Shared AMI is accessing in Destination AWS account, select the AMI in the list

 --> select private image in drop down menu


 

Step 10) keep the one Copy of the shared AMI into your AMI section.

  •  If shared AMI will be deleted from Origin Account, you will also not able to see AMI in your account 
  •  So, it is best Practice to copy shared AMI to you AMI section, it will give AMI user permission to you.

 --> select AMI --> Action --> Copy AMI

Step 11) Select Desired region , write Name , Description and Encryption (Optinal)

 --> Destination Region --> Name --> Description --> Encryption --> Copy AMI

  • Encryption - If selected, the target AMI's EBS snapshots will be encrypted with the chosen master key. You can, however, choose a different master key. All snapshots in the target AMI will be encrypted with the same key. If not selected the encryption status of the snapshots will remain unchanged.


Step 12) Now launch the AMI 


No comments:

Post a Comment

testing