AWS Elastic Beanstalk
Developer Guide (API Version 2010-12-01)
« PreviousNext »
View the PDF for this guide.Go to the AWS Discussion Forum for this product.Go to the Kindle Store to download this guide in Kindle format.Did this page help you?  Yes | No |  Tell us about it...

Getting Set Up

AWS Elastic Beanstalk provides a command line interface (CLI) to access AWS 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 them up and their environment, and includes a series of common examples of tool usage.

Prerequisites

This document assumes you can work in a Linux/UNIX or Windows environment. The AWS 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 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 for a Windows-specific command. The example output resulting from the command is shown immediately thereafter without any prefix.

Important

The command line tools used in this guide require Ruby version 1.8.7+ or Ruby version 1.9.2+ to run. To view and download Ruby clients for a range of platforms, including Linux/UNIX and Windows, go to http://www.ruby-lang.org/en/.

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 unzip 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 provided with your AWS account.

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
				

Important

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 AWS 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 UNIXOn 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, the AWS Elastic Beanstalk uses the US-East (Northern Virginia) Region (us-east-1) with the elasticbeanstalk.us-east-1.amazonaws.com 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 UNIXOn 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-east-1:

    export ELASTICBEANSTALK_URL="https://elasticbeanstalk.us-east-1.amazonaws.com"