Is it possible to programmatically rename an Elastic Beanstalk application or an application's environment?
To kick the tires, I tried the following exercise which returned a successful response, but it's not clear what changed when I look at AWS management console:
Guzzle\Service\Resource\Model\updateApplication
Updates the specified application to have the specified properties.
If a property (for example, description ) is not provided, the value remains unchanged. To clear these properties, specify an empty string.
// using Laravel PHP SDK here...
$client = AWS::get('ElasticBeanstalk');
$result = $client->updateApplication(array(
// ApplicationName is required
'ApplicationName' => 'my-current-name',
'Description' => 'my-new-name'
));
I understand that I've changed "description" rather than somethine like "NewApplicationName", but is there a way to do the re-naming?
Based on the API documentation of the service, I don't think there's a way to update an application name because it's used as the identifier for the operation: http://docs.aws.amazon.com/elasticbeanstalk/latest/api/API_UpdateApplication.html. It doesn't look like an environment name can be changed either. You might want to ask on the AWS Elastic Beanstalk forum for a definitive answer or to file a feature request: https://forums.aws.amazon.com/forum.jspa?forumID=86
馃憤
Best way I found was to clone the environment to a new name and remove the old one. The site URL will change however.
You can 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
Most helpful comment
You can keep the old url by swapping the cnames after the clone, and before destroying the original (using eb cli):