Installing and configuring the AWS Command Line Interface (CLI)

Learn how to set up AWS CLI (Amazon Web Services Command Line Interface) quickly and easily.

This article describes how to install the Amazon Web Services Command Line Interface (AWS CLI) on your account.

📘

Note

If you have not already set up an Amazon Web Services (AWS) account, you must do so before following the procedures below. To set up an Amazon AWS account, please visit http://aws.amazon.com.

Using AWS CLI at Hosting.com

To access an AWS account from your Hosting.com account, you set up a virtual environment for Python, and then install and configure the awscli package.

Before you do this, however, you must log in to the AWS console and create a user group and a user. When you do this, AWS generates the user's Access key and Secret key. You must provide both of these keys during the awscli package configuration process.

👍

Tip

Installing and configuring the awscli package

The awscli Python package enables you to access an AWS account from the command line. To install and configure the awscli package on your hosting.com account, follow these steps:

  1. Log in to your account using SSH.

  2. To create the Python virtual environment, type the following commands at the command prompt:

    cd ~
    virtualenv amazon
    
  3. To activate the virtual environment, type the following command:

    source ~/amazon/bin/activate
    

    📘

    Note

    The command prompt changes to (amazon)[email protected] to indicate that you are running within a virtual environment.

  4. To install the awscli package, type the following command:

    pip install awscli
    
  5. To make the awscli program executable, type the following command:

    chmod +x ~/amazon/bin/aws
    
  6. To configure the awscli package for access to your AWS account, type the following command:

    aws configure
    
  7. At the AWS Access Key ID prompt, type the AWS user's Access key and then press Enter.

  8. At the AWS Secret Access Key prompt, type the AWS user's Secret key and then press Enter.

  9. At the Default region name prompt, press Enter.

  10. At the Default output format prompt, press Enter. The AWS CLI is now configured for your account.

    👍

    Tip

    To view a list of commands available with the AWS CLI, type the following command at the command prompt:

    aws help
    

More Information

For more information about the AWS CLI, please visit https://aws.amazon.com/cli.

Related Articles