Keith Dawson: Develop in the Cloud
This story was written by Keith Dawson for UBM DeusM’s community Web site Develop in the Cloud, sponsored by AT&T. It is archived here for informational purposes only because the Develop in the Cloud site is no more. This material is Copyright 2012 by UBM DeusM.

Amazon's AWS Command Line

The leader takes another step away from the pack.

Amazon has introduced the developer preview of a command-line interface for managing AWS services. It portends easier automation and a widening lead for Amazon in cloud services.

Here is Amazon's introductory announcement to the AWS CLI, and here is the release itself.

The CLI tool supports around a dozen AWS services out of the gate, and the company is requesting developer feedback on which services should be added next. I say "around a dozen" because various parts of the release don't exactly agree on the supported roster -- it is an early release, after all. Among the service supported are Amazon EC2, Auto Scaling, Elastic Load Balancing, Amazon SQS, and Amazon SNS. Amazon S3 is not included in the initial list, oddly enough.

The CLI is a tool written in python, so it is relatively simple to install and get running in Windows, Mac, or Linux environments. It requires python version 2.6 or later (download here if python -V shows you are not up to date). The diehards among us can visit Amazon's aws-cli project on GitHub to see how all the pieces fit together.

Amazon's setup documentation walks you through the steps to getting the CLI tool installed and configured with your AWS account. Once you have that all set up, typing aws help at the command line will test whether everything is working correctly.

Next, the introductory documentation should suffice to get you started (or download the PDF here). Examples are given of using the CLI to launch and control EC2, Identity and Access Management, Amazon SQS (Simple Queue Service), and Amazon SNS (Simple Notification Service).

Detailed documentation at this point seems to be restricted to the help available in the CLI tool itself. Typing aws ec2 help, for example, results in a data dump on 144 "cmdlets" available for this service.

A real-world test
From a standing start, I had the AWS CLI installed and working inside of 45 minutes. This included setting up an AWS account for the first time.

First I needed to upgrade python from the version 2.4 that was present on my MacBook Pro -- it had probably arrived when I installed the Xcode developer tools. This took 7 minutes, and required figuring out how to tweak my command path to pick up the new version 2.7.3. Next, signing up for AWS required about half an hour, including retrieving my secure credentials.

Once my account had been created, I logged in, went to the console, and selected Security Settings. Then I copied the access key ID and secret key that Amazon had created for me and stored them locally in an encrypted file. These credentials need to be stored where they are accessible to the command-line environment. Once I had done this, the aws help command worked on the first try.

Though I provided Amazon with my credit card in order to get AWS set up (they already had it anyway), I don't expect to be accruing charges any time soon, because Amazon has a generous free tier of AWS services. The table lists the 28 services available (with some capacity limitations) in the free tier; the ones covered by this initial release of the AWS CLI are shown in red.

Amazon CloudFormation Amazon Simple Queue Service (SQS)
Amazon CloudFront Amazon Simple Storage Service (S3)
Amazon CloudSearch Amazon Simple Workflow Service (SWF)
Amazon CloudWatch Amazon SimpleDB
Amazon DynamoDB Amazon Virtual Private Cloud (VPC)
Amazon Elastic Compute Cloud (EC2) Auto Scaling
Amazon Elastic MapReduce AWS Data Pipeline
Amazon ElastiCache AWS Direct Connect
Amazon Glacier AWS Elastic Beanstalk
Amazon Mechanical Turk AWS Import/Export
Amazon Relational Database Service (RDS) AWS Storage Gateway
Amazon Route 53 Elastic Block Store (EBS)
Amazon Simple Email Service (SES) Elastic Load Balancing
Amazon Simple Notification Service (SNS) Product Advertising API