Menu
AWS for DevOps
Getting Started Guide

Step 3.2: Download the Source Code for AWS Elastic Beanstalk

In this step, you will download and prepare the source code that you will deploy to an Elastic Beanstalk deployment target as part of Step 7.2: Elastic Beanstalk Pipeline.

If you want to download the source code for AWS CodeDeploy, go to Step 3.1: AWS CodeDeploy Source Code.

If you want to download the source code for AWS OpsWorks, go to Step 3.3: AWS OpsWorks Source Code.

To download the source code for Elastic Beanstalk

  1. You should already be logged in to the instance that you launched in Step 2.3: Launch an Amazon EC2 Instance to Access the AWS CodeCommit Repository. If not, follow the instructions in Connect to Your Linux Instance in the Amazon EC2 User Guide for Linux Instances.

  2. From the command prompt on the instance, run the pwd command to confirm you are in the /home/ec2-user/my-demo-repo directory (also referred to as the ~/my-demo-repo directory). If a path other than /home/ec2-user/my-demo-repo appears in the output, run the cd ~/my-demo-repo command.

  3. Download the source code for Elastic Beanstalk into the ~/my-demo-repo directory, and then prepare the source code for deployment by running the following commands, one at a time.

    Copy
    wget http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/samples/php-v1.zip
    Copy
    unzip php-v1.zip
    Copy
    rm php-v1.zip
  4. Explore the source code. Otherwise, go to Step 3.4: Push the Source Code.

To explore the source code for Elastic Beanstalk

  1. From the ~/my-demo-repo directory, run these commands to display the contents of the extracted files in read-only mode.

    Copy
    less cron.yaml
    Copy
    less index.php
    Copy
    less scheduled.php
    Copy
    less styles.css
    Copy
    less .ebextensions/logging.config

    To move up or down one line at a time, press the k or j key, respectively. To move up or down one page at a time, press b or the space bar, respectively. To exit, press the q key.

    The cron.yaml file contains the definition of a periodic background task for Elastic Beanstalk to run in conjunction with the scheduled.php page. The logging.config file contains application logging settings. For more information, see Periodic Tasks and Advanced Environment Customization with Configuration Files (.ebextensions) in the AWS Elastic Beanstalk Developer Guide.

  2. After you are finished exploring the contents, go to Step 3.4: Push the Source Code.