How to move ec2 to another account

0

Hello!

I have an ec2 instance (which I bought for 1 year) on my account, is it possible to move it to a different account?

Thanks.

  • @rePost-User-8229200 - are you referring Reserved Instance in your question as you mentioned that you bought for an year ? Are both accounts belongs to same organization account ?

3 Answers
1

Unfortunately it is not possible to directly transfer existing Amazon EC2 instances or Amazon Machine Images (AMIs) between AWS accounts. However, you can manually migrate an EC2 image from one AWS account to another by following these steps:

  1. Launch an EC2 instance in the source account using the AMI you want to migrate.
  2. Once the instance is running, create an AMI from it. This AMI will now be owned by the source account.
  3. Share the new AMI with the target account by modifying the AMI permissions.
  4. Switch to the target account and launch an EC2 instance using the shared AMI from the source account.
  5. Create a new AMI in the target account from the instance launched in step 4.
  6. This new AMI in the target account will be a copy of the original that can now be used going forward.

The Knowledge article provides additional information : https://repost.aws/knowledge-center/account-transfer-ec2-instance

AWS
answered 6 months ago
profile pictureAWS
EXPERT
reviewed 6 months ago
  • Thanks for the answer! I need to move the resources itself, not the EC2 image. Let's say we just both the machine from the wrong account. Is it possible to move it somehow?

0

There is no method to move a running instance to another account. You can migrate it to another account in many different ways, depending on how you created and manage the instance.

If you used infrastructure as code (CloudFormation, Terraform, Pulumi, hand coded, etc.), you may be able to simply deploy into another account, then.

If you have state on the instance volume(s), you can snapshot the Amazon Machine Image and Elastic Block Store volumes, share them with the other account, then create the instance and attach volumes created from the snapshots. This will have some downtime.

If your application is compatible, you could also use the Amazon Application Migration Service to migrate the application.

Regardless of how you migrate the application, if you wish to minimize downtime, you may need to use the Database Migration Service to ensure the databases are up to date and then manage how your users access the application in a manner that allows seamless transfer to the new location.

profile pictureAWS
answered 6 months ago
profile pictureAWS
EXPERT
reviewed 6 months ago
  • Thanks for the answer! I do not care about data on EC2 instance, I am interested in moving the EC2 resources itself. I need this machine on another account (without any data). Is it possible?

  • Yes, in all the ways I presented above.

0

This is possible if the account that the Reserved Instance is in now (the source account) and the account that you want to be able to run the Reserved Instance in (the target account) are both within the same AWS Organisation.

This is described in much more detail here https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/ri-turn-off.html

A similar question from a couple of years ago, which again has a lot of useful information in the accepted answer, is here https://repost.aws/questions/QUQabLrEJvSGiYpdqpa2pMzw/transfer-ec2-and-savings-plan-from-one-aws-account-to-another

If the source and target accounts are not under the same AWS Organisation then the source account may still be able to sell the RI to the target account using Amazon EC2 Reserved Instances Marketplace https://aws.amazon.com/ec2/pricing/reserved-instances/marketplace/

profile picture
EXPERT
Steve_M
answered 6 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions