Amazon has introduced a new command line interface which interfaces with several of the services they provide. Let’s take a look at installing it.

Requires Python 2.6 or later.

Install options

We can use pip:

Console - user@hostname ~ $

1
sudo pip install awscli

We can use easy_install:

Console - user@hostname ~ $

1
sudo easy_install awscli

Or we can download it from github:

Console - user@hostname ~ $

1
2
3
git clone https://github.com/aws/aws-cli.git
cd aws-cli
sudo python setup.py install

Credentials

Can use the environment variables AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY. Or can use a configuration file which is found with the AWS_CONFIG_FILE environment variable. Finally an IAM role could be used. See HowTo: Install AWS CLI - Security Credentials to see how to set these.

Help

Console - user@hostname ~ $

1
aws help

Console - user@hostname ~ $

1
aws ec2 help

Console - user@hostname ~ $

1
aws ec2 describe-instances help

Sample Command

Console - user@hostname ~ $

1
aws --region us-east-1 ec2 describe-availability-zones

Supported services

The full list of services the AWS CLI supports can be found in the Available Services section of the AWS CLI Command Reference.

Resources

Parts in this series