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
For information about how to create an AWS user group and user, please visit the official Amazon documentation site at http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_WorkingWithGroupsAndUsers.html.
For information about how to obtain a user's Access key and Secret key, please visit the official Amazon documentation site at http://docs.aws.amazon.com/IAM/latest/UserGuide/ManagingCredentials.html.
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:
-
Log in to your account using SSH.
-
To create the Python virtual environment, type the following commands at the command prompt:
cd ~ virtualenv amazon
-
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.
-
To install the awscli package, type the following command:
pip install awscli
-
To make the awscli program executable, type the following command:
chmod +x ~/amazon/bin/aws
-
To configure the awscli package for access to your AWS account, type the following command:
aws configure
-
At the AWS Access Key ID prompt, type the AWS user's Access key and then press Enter.
-
At the AWS Secret Access Key prompt, type the AWS user's Secret key and then press Enter.
-
At the Default region name prompt, press Enter.
-
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
Updated 3 days ago