How to deploy a new application version in Elastic Beanstalk
Welcome to CloudAffaire and this is Debjeet.
In the last blog post, we have discussed how to deploy an application using Elastic Beanstalk.
In this blog post, we will discuss how to deploy a new application version in Elastic Beanstalk.
How to deploy a new application version in Elastic Beanstalk:
Elastic Beanstalk automatically creates an application version whenever you deploy an application for the 1st time, create a new environment of existing application or upload source code to an existing application version in existing environment. Application version enables an application developer to undo redo changes in application. For example, suppose your latest deployment has some bug, you can quickly apply the previous working version of your application using application version. Application version also support source bundle stored in S3, where you keep your new application version ready by uploading it to an S3 bucket without deploying it. Elastic Beanstalk deletes these application versions according to the application’s lifecycle policy or when you delete the application.
Next, we are going to deploy a new application version to our PHP web application.
Prerequisite for this demo:
- PHP web application deployed to Elastic Beanstalk (as per previous blog post)
Step 1: Login to the AWS console and navigate to ‘Elastic Beanstalk’.
Step 2: From ‘Actions’ click ‘View application versions’.
Step 3: Click ‘Upload’, to upload a new application version.
Note: We already have one application version created by default when we deployed our application.
Step 4: Choose your file and provide a version label. Click ‘Upload’ to upload the code.
You can download MyShoppingListV2.zip from below GitHub repository.
New application version created successfully.
The application code is uploaded to S3 bucket.
Next, we are going to deploy this new application version.
Step 5: Select the version that you want to deploy and from ‘Actions’ click ‘Deploy’.
Select the environment and click ‘Deploy’.
Note: Currently we have only one environment for our application.
New application version deployed successfully.
Navigate to application root and from ‘Actions’ click ‘Delete application’.
Provide application name and click ‘Delete’.
Hope you have enjoyed this article. In the next blog post, we will discuss application version lifecycle in Elastic Beanstalk.
To get more details on AWS Elastic Beanstalk, please refer below AWS documentation