user1980099
user1980099

Reputation: 643

Copy configuration of one aws account to another

I would like to copy configuration (like VPC, P) of one Amazon account to another account. I need to export template of the first account and import it to other.

I would like to know what it the right way to do it? what are the things I need to take to my attention?

Can someone can direct me to good document/video that explain how export/import configuration to a template and what are the things I need to consider?

Thanks.

Upvotes: 4

Views: 4143

Answers (2)

Steven K7FAQ
Steven K7FAQ

Reputation: 988

In case someone else lands here looking for ideas ...

One way you can 'duplicate' a CloudFormation between AWS Accounts is to save it locally (your local disk). This is a simple task - Starting in the CloudFormation App in the account hosting the CF stack you want to duplicate:

  1. Click on the icon in the top left that looks like a piece of paper.
  2. Select Save
  3. Select Local File
  4. Select location on your drive and the name to save as.

Switch to the other AWS Account to import the stack into and open CloudFormation:

  1. Click "Create Stack" (blue button)
  2. Click "Design template"
  3. Click on the icon in the top left that looks like a piece of paper.
  4. Select Open
  5. Select Local File
  6. Select the file you saved.

Upvotes: 2

John Rotenstein
John Rotenstein

Reputation: 270224

There is no easy way to copy resources from one AWS account to another.

The closest option is to create a CloudFormation template that matches your resources, and then use CloudFormation to deploy those resources in the other account.

There are various tools and services that can create CloudFormation templates from existing resources:

You will need to consider things such as:

  • Create the VPC first, so resources can be created inside the VPC and Subnets
  • If your Amazon EC2 instances were created via CloudFormation or Auto Scaling, you'll want to create them in the other account in the same way, rather than manually creating the instances
  • Amazon Machine Images (AMIs) can be shared between accounts, which is easier than creating new ones
  • You'll need to also replicate IAM Roles that are used by other services

Bottom line: You'll need a good understanding of your existing configuration to be able to reproduce it elsewhere, to make sure it works in the same manner. Hopefully, you've documented what you've created along the way.

Upvotes: 3

Related Questions