with AWS Elastic Beanstalk

In this tutorial, you will learn how to modify your existing AWS Elastic Beanstalk application and then terminate that application. This tutorial is a continuation from the Launch an Application with AWS Elastic Beanstalk tutorial, so please go through that tutorial first if you haven’t already. This tutorial will cover how to update your existing application and then how to get rid of your Elastic Beanstalk environment, which includes your application.

Updating an Application with AWS Requires an Account

Create a Free Account in Minutes

Receive twelve months of access to the AWS Free Usage Tier and enjoy AWS Basic Support features including, 24x7x365 customer service, support forums, and more.

 


a. Navigate to the directory where you downloaded the php_v1.zip file in the previous tutorial.

Windows Users: To unzip the php-v1.zip file, right click on the php-v1.zip file, click Extract All..., then click Extract.

Mac Users: Double click on the php-v1.zip file, and this will automatically unzip the file into a php-v1 folder in the same directory.


b. Navigate into the newly unzipped php-v1 directory. Open index.php using your favorite text editor. You will make a small edit here that is an example of an application change. Look on line 26 for <h1>Congratulations!</h1>. Replace Congratulations!, with Application Updated! in between the <h1> and </h1> tags. Then save the index.php file (overwriting the original).

Getting-Started-EB2-1c

(click to zoom)

Getting-Started-EB2-1c

Next you will need to zip your application so it can be uploaded to AWS as an update package.

Windows users: Please select Windows below to see how to create the zipped application file.

Mac & Linux users: Please select Mac/Linux below to see how to create the zipped application file.

  • Windows

    c. Select all 6 items (including the .ebextensions directory), right-click on .ebextensions, select Send to, and then click on Compressed (zipped) folder.

    Getting-Started-EB2-1e - windows

    (click to zoom)

    Getting-Started-EB2-1e - windows

    d. Rename the newly created zip file to php-v2.zip.

    Note: On some Windows systems the .zip part of the file name may be hidden (see the example image).

    Getting-Started-EB2-1e2 - windows

    (click to zoom)

    Getting-Started-EB2-1e2 - windows
  • Mac/Linux

    c. OSX users: Open a terminal window by pressing command + space and typing terminal in the search window. Then press enter to open the terminal window.

    Linux users: Open a terminal window.

    Getting-Started-CLI-OSX1

    (click to zoom)

    Getting-Started-CLI-OSX1

    d. Next, you need to navigate to the directory where you downloaded the php-v1.zip file (the default location for file downloads is the Downloads directory so the example here uses that directory; if you downloaded to a different directory, change to that directory instead). (ex. cd ~/Downloads/php-v2)

    When you are in the directory with the index.php file you modified in step 1 part b, zip the files (and a hidden directory called .ebextensions) by typing zip –r php-v2.zip .e* * to create php-v2.zip with the updated PHP project in it.

    Getting-Started-EB2-1e2 - mac

    (click to zoom)

    Getting-Started-EB2-1e2 - mac

a. Click here to open the Elastic Beanstalk console. Within the Elastic Beanstalk dashboard, click on php-sample-app at the top of your screen, and this should show a drop-down menu where you should select Application Versions.

Getting-Started-EB2-2a

(click to zoom)

Getting-Started-EB2-2a

b. Here you should see one entry in the Version Label column titled First Release. The Source column for this entry should show the php-v1.zip file we uploaded in the previous tutorial. Click on Upload, enter Second Release for Version label, then Sample PHP App Update for Description. Click Browse, then navigate to the location where your php-v2.zip file is located, Select the php-v2.zip file and click Upload.

Getting-Started-EB2-2b

(click to zoom)

Getting-Started-EB2-2b

c. You should now see Second Release within the application versions table. Check the box for Second Release, then click Deploy. You should see your Environment defaulted to phpSampleApp-env. Leave the default settings here and click Deploy. Lastly, click Elastic Beanstalk in the top left hand corner of the web page.

Getting-Started-EB2-2c

(click to zoom)

Getting-Started-EB2-2c

d. Click on the green box titled phpSampleApp-env to see the view of your application's environment.

Getting-Started-EB2-green_box

(click to zoom)

Getting-Started-EB2-green_box

e. Here, you can see a Recent Events section that displays your application being updated.

Getting-Started-EB2-2d

(click to zoom)

Getting-Started-EB2-2d

a. Once you see Environment update completed successfully within Recent Events, click on your application URL toward the center top of the screen to view your updated application.

Getting-Started-EB2-3a

(click to zoom)

Getting-Started-EB2-3a

b. You will see that instead of the Congratulations! text that existed in version 1 of your application the text has been updated to version 2 with the heading Application Updated!

Congratulations! You have successfully updated your AWS Elastic Beanstalk application.

Getting-Started-EB2-3b

(click to zoom)

Getting-Started-EB2-3b

a. To delete your application (and stop using the AWS resources associated with your application), access your Elastic Beanstalk application dashboard, click on Actions in the top right-hand corner, then select Terminate Environment.

Getting-Started-EB2-4a

(click to zoom)

Getting-Started-EB2-4a

b. You will be presented with a warning/confirmation screen. Click Terminate to continue.

Note: It may take a couple of minutes for the environment to completely shut down.

Getting-Started-EB2-4b

(click to zoom)

Getting-Started-EB2-4b

Now that you have an Elastic Beanstalk application up and running, the next tutorial will walk you through registering a domain name so your website/application can be easy to access.

Getting a Domain for Your Application »


Yes
No