Can you Transfer an EC2 Instance to another AWS Account

amazon ec2

Is there a way to give an entire EC2 instance to a different party. Basically I was managing a EC2 Server for a client and am now giving up maintenance of the server. I don't want to be billed for this instance anymore. Instead of backing up our application and configuring a new server under the clients account I would prefer to just give them the whole instance that is preconfigured to save time. Is this possible.

Best Answer

You cannot transfer an EC2 instance (or any other resources) to a different AWS account.

If the instance is EBS boot (recommended), you might try an approach like this:

  1. Stop the current instance (ec2-stop-instances)

  2. Create an AMI from the instance (ec2-register-image)

  3. Give the second AWS account permission to run that AMI (ec2-modify-image-attribute)

  4. Run a new instance of the AMI under the second AWS account (ec2-run-instances)

DNS would need to be updated to point to the IP address of the new instance (preferably using an Elastic IP Address). Any other AWS/EC2 resources would also need to be copied/recreated in the second account.

After sufficient testing, you might want to free up the original instance (ec2-terminate-instances).

The second account should create their own snapshots / AMIs of the instance to protect themselves if their instance/EBS volume fails after the AMI owned by you is deleted.

Even better, you should have documented/scripted exactly how your instance was created so that the client can reproduce this at will.

Related Topic