How do I migrate my Elastic Beanstalk environment from one AWS account to another AWS account?

3 minute read

I want to migrate my AWS Elastic Beanstalk environment from one AWS account to another AWS account.

Short description

You must use saved configurations to migrate an Elastic Beanstalk environment between AWS accounts.

Saved configurations are stored in the Amazon Simple Storage Service (Amazon S3) bucket for Elastic Beanstalk in a folder named after your application. For example, the location of a saved configuration for an application named my-app in the us-east-1 AWS Region for account 01234567890 looks like this:



In the following steps, Account A is the account where you have your Elastic Beanstalk environment. Account B is the account that you want to migrate your Elastic Beanstalk Environment to.

Note: In this example, both Account A and Account B have Elastic Beanstalk environments already created. The saved configuration is created by Elastic Beanstalk when you create the environment. This environment is uploaded to Account B's Amazon S3 bucket.

Create a saved configuration for Account A

1.    Create a saved configuration in Account A.

2.    Download the saved configuration to your local machine from the following:


Note: In your saved configuration, us-east-1 is the AWS Region where the Elastic Beanstalk environment is located in Account A. The account-a-id is your account ID for Account A. The application-a-name is the application name of the Elastic Beanstalk application in Account A.

3.    Change your account-specific parameters in the downloaded configuration file, and then save the changes. For example, change the key pair name, subnet ID, or application name (such as application-b-name).

Create an Elastic Beanstalk environment using the saved configuration in Account B

1.    Log in to Account B.

2.    Upload the saved configuration from your local machine to an S3 bucket in Account B.

The S3 path looks similar to the following:


3.    Open the Elastic Beanstalk console.

4.    From the Regions list, select your AWS Region.

5.    From the navigation pane, choose Applications, and then choose Create a new application.

6.    For Application name, enter the name of your new application (for example, application-b-name).

7.    From the left navigation pane, in the section for your new application, choose Saved configurations.

Now you can see all the saved configurations that you have in the S3 bucket in a given Region for your account.

8.    Choose the saved configuration that you previously uploaded to the S3 bucket in the following account:


9.    Launch your Elastic Beanstalk environment.

AWS OFFICIALUpdated 2 years ago