3

I have two amazon aws account's and i want to move all SQS EC2 RDS S3 CLOUDFRONT SECURITY GROUP'S to the new account .

And i have EC2 account id and account secret key in the AMI IMAGE for AWS CLI after moving to the new account how can i change all EC2 account id and account secret key to new account?

What is the best and fast way to do so?

Thank You

Tereance
  • 107
  • 2
  • 11
  • I have the same issue but with a few more services like **SNS**, **ECS**, **Route 53** and **VPC** that I need to migrate duplicate to an entire new account. With de DNS's it's not possible to copy once that depends on unique names, but with the other services I need to a easy way to do that, by services. Could you help guys? I've been reading about Amazon Organizations... – felipe_dmz Dec 07 '18 at 18:10

2 Answers2

3

Some of what you've mentioned is configuration. Some is content. Let's unroll it and go through each one. Generally, the answer is "no".

SQS

Create a new SQS queue and point code/configuration at it. Alternatively, you can enable cross-account delegation (though this doesn't change ownership).

EC2

Running instances cannot be moved. Either create new instances and reprovision them (with, say, ansible/salt/puppet/chef) or create an AMI of the EC2, share the ami, and relaunch.

RDS

RDS instances can't be copied. You will need to extract the data and transfer it to a new database instance.

S3

Buckets cannot be moved between accounts. You can copy data into a new bucket or enable cross-account delegation (though this doesn't change ownership).

CLOUDFRONT

Cloudfront cannot be moved. Creating this in a new account is very easy, though, since it's basically stateless (you don't need to worry about anything beyond setting it up).

SECURITY GROUP'S

Security groups cannot be moved.

Accounts and secrets

And i have EC2 account id and account secret key in the AMI IMAGE for AWS CLI after moving to the new account how can i change all EC2 account id and account secret key to new account?

Use AWS IAM to generate correct user(s) with security keys. This involves using a new ID and key. If you are using IDs and keys you should be comfortable rotating them to reduce security risk.

The alternative is to use IAM roles, which means you don't need to store or use explicit keys.

The bottom line

Ultimately, you should be keeping most of this information in configuration management. This is almost trivial to do with CloudFormation, which describes an entire stack (EC2, cloudfront, security groups, databases) and can create them in a single command.

Community
  • 1
  • 1
tedder42
  • 23,519
  • 13
  • 86
  • 102
0

I would just use AWS Organizations to roll up your child account into the parent one, rather than trying to move everything by hand.

Dan Csharpster
  • 2,662
  • 1
  • 26
  • 50