Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change an application name in AWS Elastic Beanstalk

I being struggling with the name of an application given that I had gave it a wrong name. Is there a way to change the application name ? if not what possible solution would you recommend me to do in this case.

like image 370
Camilo A. Hernández Avatar asked Sep 16 '25 20:09

Camilo A. Hernández


2 Answers

You cannot change the name of an Elastic Beanstalk application. However, here is how I moved an environment to a new application. In the end you will have a new environment within a new application with an almost identical configuration as your existing environment and application.

The big steps are…

  1. Create your new application
  2. Clone your old environment into the new application
  3. Destroy your old application

We'll dig into each one below.

Prerequisites

To follow you these instructions you'll need to…

  • Install and configure the AWS CLI
  • Install and configure the Elastic Beanstalk CLI

Create your new application

Run aws elasticbeanstalk create-application --application-name my-new-application

Clone your old environment into the new application

  • Save your old environment's config eb config save
  • Find your config in .elasticbeanstalk/saved_configs/<my config>.cfg.yml
  • Change application_name: <old application name> to your new application name in .elasticbeanstalk/config.yml
  • Upload your config to the new environment using its name without the .cfg.yml extension eb config put <config name>
  • Create your new environment eb create <environment name> --cfg <config name>

Destroy your old application

When you're sure all is well with your new application, clean up your old application using this guide from Amazon.

Notes

  • Make sure you turn on instance protection for your db before you destroy the old environment if you want to keep your data.
  • If you run into trouble on the new server, take a look at the Elastic Beanstalk logs using tail /var/log/eb-engine.log or cd /var/app/current to look at your deployed app.
like image 191
KalebLape Avatar answered Sep 19 '25 10:09

KalebLape


How about this ?

clone the environment to a new name and remove the old one. The site URL will change however.

keep the old url by swapping the cnames after the clone, and before destroying the original (using eb cli):

eb swap original-environment-name -n new-environment-name
like image 39
Jatin Mehrotra Avatar answered Sep 19 '25 11:09

Jatin Mehrotra