AWS Elastic Beanstalk
Developer Guide

Getting Set Up


This tool, the Elastic Beanstalk API CLI, and its documentation have been replaced with the AWS CLI. See the AWS CLI User Guide to get started with the AWS CLI. Also try the EB CLI for a simplified, higher-level command line experience.

Elastic Beanstalk provides a command line interface (CLI) to access Elastic Beanstalk functionality without using the AWS Management Console or the APIs. This section describes the prerequisites for running the CLI tools (or command line tools), where to get the tools, how to set up the tools and their environment, and includes a series of common examples of tool usage.


This document assumes you can work in a Linux/UNIX or Windows environment. The Elastic Beanstalk command line interface also works correctly on Mac OS X (which resembles the Linux and UNIX command environment), but no specific Mac OS X instructions are included in this guide.

As a convention, all command line text is prefixed with a generic PROMPT> command line prompt. The actual command line prompt on your machine is likely to be different. We also use $ to indicate a Linux/UNIX-specific command and C:\> for a Windows-specific command. The example output resulting from the command is shown immediately thereafter without any prefix.

The command line tools used in this guide require Ruby (version 1.8.7+ or 1.9.2+) and Python version 2.7 to run. To view and download Ruby clients for a range of platforms, including Linux/UNIX and Windows, go to Python is available at


If you are using Linux with a system version of Linux lower than 2.7, install Python 2.7 with your distribution's package manager and then modify the eb script under eb/linux/python2.7/eb to refer to the Python 2.7 executable:

#!/usr/bin/env python2.7

Additionally, you need to install the boto module with pip:

$ sudo /usr/bin/easy_install-2.7 pip $ sudo pip install boto

Getting the Command Line Tools

The command line tools are available as a .zip file on the AWS Sample Code & Libraries website. These tools are written in Ruby, and include shell scripts for Windows 2000, Windows XP, Windows Vista, Windows 7, Linux/UNIX, and Mac OS X. The .zip file is self-contained and no installation is required; simply download the .zip file and extract it to a directory on your local machine. You can find the tools in the api directory.

Providing Credentials for the Command Line Interface

The command line interface requires the access key ID and secret access key. To get your access keys (access key ID and secret access key), see How Do I Get Security Credentials? in the AWS General Reference.

You need to create a file containing your access key ID and secret access key. The contents of the file should look like this:

AWSAccessKeyId=Write your AWS access ID AWSSecretKey=Write your AWS secret key


On UNIX, limit permissions to the owner of the credential file:

$ chmod 600 <the file created above>

With the credentials file set up, you'll need to set the AWS_CREDENTIAL_FILE environment variable so that the Elastic Beanstalk CLI tools can find your information.

To set the AWS_CREDENTIAL_FILE environment variable

  • Set the environment variable using the following command:

    On Linux and UNIX On Windows
    $ export AWS_CREDENTIAL_FILE=<the file created above> C:\> set AWS_CREDENTIAL_FILE=<the file created above>

Set the Service Endpoint URL

By default, AWS Elastic Beanstalk uses the US East (N. Virginia) region (us-east-1) with the service endpoint URL. This section describes how to specify a different region by setting the service endpoint URL. For information about this product's regions, go to Regions and Endpoints in the Amazon Web Services General Reference.

To set the service endpoint URL

  • Set the environment variable using the following command:

    On Linux and UNIX On Windows
    $ export ELASTICBEANSTALK_URL=<service_endpoint> C:\> set ELASTICBEANSTALK_URL=<service_endpoint>

    For example, on Linux, type the following to set your endpoint to us-west-2:


    For example, on Windows, type the following to set your endpoint to us-west-2: