AWS Command Line Interface
User Guide (Version 1.0.0)
« PreviousNext »
View the PDF for this guide.Go to the AWS Discussion Forum for this product.Did this page help you?  Yes | No |  Tell us about it...

Getting Set Up with the AWS Command Line Interface

Before you can start using the AWS Command Line Interface, you must sign up for an AWS account (if you don't already have one) and set up your environment. Depending on your environment, there are three different ways to install the AWS CLI: MSI installer, a bundled installer, or pip. The following sections will help you decide which option to use.

Note

The AWS CLI is pre-installed on the latest versions of the Amazon Linux AMI. If you need a more recent version of the AWS CLI than what is pre-installed, remove the package from the AMI (yum remove aws-cli) and then follow one of the installation procedures in this section.

Sign Up

To access AWS, you will need to sign up for an AWS account. If you already have an AWS account, you can skip to the next section.

To sign up for an AWS account

  1. Go to http://aws.amazon.com, and then click Sign Up.

  2. Follow the on-screen instructions.

    Part of the sign-up procedure involves receiving a phone call and entering a PIN using the phone keypad.

AWS sends you a confirmation email after the sign-up process is complete. At any time, you can view your current account activity and manage your account by going to http://aws.amazon.com and clicking My Account/Console.

To get your access key ID and secret access key

Access keys consist of an access key ID and secret access key, which are used to sign programmatic requests that you make to AWS. If you don't have access keys, you can create them by using the AWS Management Console.

Note

To create access keys, you must have permissions to perform the required IAM actions. For more information, see Granting IAM User Permission to Manage Password Policy and Credentials in Using IAM.

  1. Go to the IAM console.

  2. From the navigation menu, click Users.

  3. Select your IAM user name.

  4. Click User Actions, and then click Manage Access Keys.

  5. Click Create Access Key.

    Your keys will look something like this:

    • Access key ID example: AKIAIOSFODNN7EXAMPLE

    • Secret access key example: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY

  6. Click Download Credentials, and store the keys in a secure location.

    Your secret key will no longer be available through the AWS Management Console; you will have the only copy. Keep it confidential in order to protect your account, and never email it. Do not share it outside your organization, even if an inquiry appears to come from AWS or Amazon.com. No one who legitimately represents Amazon will ever ask you for your secret key.

Related topics

Install the AWS CLI Using the MSI Installer (Windows)

For Windows users, an MSI installation package offers a familiar and convenient way to install the AWS CLI without any prerequisites. This is the recommended way for Windows users looking to quickly get started with the AWS CLI.

Prerequisites

  • Windows XP or later

To install the AWS CLI using the MSI installer

  1. Download the appropriate MSI installer.

  2. Run the downloaded MSI installer.

  3. Follow the instructions that appear.

Install the AWS CLI Using the Bundled Installer (Linux, OS X, or Unix)

If you are on Linux, OS X, or Unix, you can use the bundled installer to install the AWS CLI. The bundled installer handles all the details in setting up an isolated environment for the AWS CLI and its dependencies. You don't have to be fluent in advanced pip/virtualenv usage, nor do you have to worry about installing pip.

Prerequisites

  • Linux, OS X, or Unix

  • Python 2.6.3 or later

To see if you have Python installed, type the following at a command prompt:

python --version

Install Python

If your computer doesn't already have Python installed, or you would like to install a different version of Python, follow this procedure.

To install Python

  1. Download the Python package for your operating system.

  2. Install Python.

  3. Verify the Python installation by typing the following at a command prompt:

    python --help

Install the AWS CLI Using the Bundled Installer

Follow these steps to install the AWS CLI using the bundled installer.

To install the AWS CLI using the bundled installer

  1. Download the AWS CLI Bundled Installer.

  2. Unzip the package.

  3. Run the install command.

On Linux, here are the three commands that correspond to each step:

$ wget https://s3.amazonaws.com/aws-cli/awscli-bundle.zip
$ unzip awscli-bundle.zip
$ sudo ./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws

Assuming you have sudo permissions, the last command will install the AWS CLI at /usr/local/aws and create the symlink aws at the /usr/local/bin directory. Using the -b option to create a symlink eliminates the need to specify the install directory in the user's $PATH variable. This should enable all users to call the AWS CLI by typing aws from any directory.

Alternatively, if you have no sudo permissions or want to install the AWS CLI only for the current user, you can run the following command.

$ ./awscli-bundle/install -b ~/bin/aws

This will install the AWS CLI to the default location (~/.local/lib/aws) and create a symlink at ~/bin/aws. Make sure that ~/bin is in your $PATH variable for the symlink to work.

To see further explanation of the -i and -b options, type the following at the command prompt.

$ ./awscli-bundle/install -h

The bundled installer does not put anything outside of the installation directory with the exception of the optional symlink, so uninstalling is as easy as simply deleting the installation directory.

Install the AWS CLI Using pip (Windows, Linux, OS X, or Unix)

pip is a Python-based tool that offers convenient ways to install, upgrade, and remove Python packages and their dependencies.

Prerequisites

  • Windows, Linux, OS X, or Unix

  • Python 2.6.3 or later

  • pip

To see if you have Python installed, type the following at a command prompt:

python --version

To see if you have pip installed, type the following at a command prompt:

pip --help

Install Python

If your computer doesn't already have Python installed, or you would like to install a different version of Python, follow this procedure.

To install Python

  1. Download the Python package for your operating system.

  2. Install Python.

  3. Verify the Python installation by typing the following at a command prompt:

    python --help

    If Python appeared to install correctly but does not return help, you may need to add the location of the Python executable (for example, C:\Python27) to your PATH environment variable.

Install pip

If your computer doesn't already have pip installed, follow this procedure.

To install pip

  1. You can install pip in three ways: easy_install, apt-get/yum (on Linux only), or manual setup.

    1. If you have easy_install (check by running easy_install --help), type the following at a command prompt to set up pip.

      easy_install pip
    2. If you are on Linux, you can use apt-get or yum to install pip.

      On Debian or Ubuntu:

      $ sudo apt-get install python-pip

      On Amazon Linux or Fedora:

      $ sudo yum install python-pip
    3. To install pip manually, you need to download two files: setuptools(ez_setup.py) and pip(get-pip.py). Then, run the following two commands.

      python ez_setup.py
      python get-pip.py
  2. Verify your pip installation by typing the following at your command prompt:

    pip --help

Note

If you are using Windows, you must update your path with the directory where pip was installed, which defaults to the Scripts subdirectory of the Python installation directory. For example, if you installed Python 2.7 to C:\Python27, you would add the path C:\Python27\Scripts to your PATH environment variable.

Install the AWS CLI Using pip

With Python and pip installed, you can use the following command to install the AWS CLI.

pip install awscli

To upgrade, simply use the --upgrade option.

pip install --upgrade awscli

Test the AWS CLI Installation

To ensure that the AWS CLI is installed and set up correctly, type the following AWS CLI command at a command prompt:

aws help

If the test is successful, you will see the help displayed.

Important

Before using the AWS CLI, you will need to provide some configuration values. To proceed, see Configuring the AWS Command Line Interface.