How do I migrate my Elastic Beanstalk environment from one AWS account to another AWS account?
Last updated: 2020-06-10
I want to migrate my AWS Elastic Beanstalk environment from one AWS account to another AWS account.
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.
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. Choose Create Application.
5. For Application name, enter the name of your new application (for example, application-b-name).
6. From the navigation pane, 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.
7. Choose the saved configuration that you previously uploaded to the S3 bucket in the following account:
8. Launch your Elastic Beanstalk environment.