DEV Community

vladi160
vladi160

Posted on

Moving an EC2 instance from one AWS account to another.

Moving an EC2 instance from one AWS account to another can be done by following these steps. Please note that you will need access to both the source and destination AWS accounts to complete this process.

Create an Amazon Machine Image (AMI) of the EC2 instance:

a. In the source AWS account, go to the EC2 Management Console.
b. Select the instance you want to move.
c. Click on 'Actions', then select 'Create Image'.
d. Provide a unique name and description for the image and click 'Create Image'.
e. Wait for the AMI creation process to complete.

Share the AMI with the destination AWS account:

a. In the source AWS account, go to the 'AMIs' section of the EC2 Management Console.
b. Select the newly created AMI.
c. Click on 'Actions', then select 'Modify Image Permissions'.
d. Enter the destination AWS account ID and click 'Add Permission'.
e. Save the changes.

Launch a new EC2 instance in the destination AWS account:

a. In the destination AWS account, go to the EC2 Management Console.
b. Click on 'Launch Instance'.
c. Select 'My AMIs' from the left-hand menu.
d. Choose the shared AMI from the source account and click 'Select'.
e. Follow the standard process to configure and launch the new EC2 instance.

a. After verifying that the new EC2 instance is working correctly, terminate the old instance in the source account to avoid incurring unnecessary charges.

Top comments (0)