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

Supported services

  • Auto Scaling
  • CloudFormation
  • CloudWatch
  • Elastic Beanstalk
  • Elastic Compute Cloud (EC2)
  • Elastic Load Balancing
  • Identity and Access Management (IAM)
  • Relational Database Service (RDS)
  • Security Token Service (STS)
  • Simple Email Service (SES)
  • Simple Notification Service (SNS)
  • Simple Queue Service (SQS)

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

Resources

Parts in this series

Comments