Monday, December 10, 2012

Installing the Amazon EC2 API Tools

This post is deprecated. Please check this post here - Amazon EC2 Command Line Tools Installation Guide.

The Amazon EC2 API tools allow you to access admin console functions in command line. The following instructions are for Ubuntu Server 12.04.1 LTS.

1) Enable multiverse
sudo perl -pi.orig -e   'next if /-backports/; s/^# (deb .* multiverse)$/$1/'   /etc/apt/sources.list

2) Enable the awstools
sudo apt-add-repository ppa:awstools-dev/awstools
sudo apt-get update

3) Install AWS command line tools
sudo apt-get install ec2-api-tools ec2-ami-tools iamcli rdscli
sudo apt-get install aws-cloudformation-cli elbcli


Create the AWS X.509 certificate at https://aws-portal.amazon.com/gp/aws/securityCredentials if you don't have it already.


mkdir $HOME/.aws

Then copy the cert- and pk- files to the following directories.

$HOME/.aws/cert-{some_id}.pem
$HOME/.aws/pk-{some_id}.pem

Create the file $HOME/.aws/aws-credential.txt and put the following into the file (Your access_key and secret key are available at https://aws-portal.amazon.com/gp/aws/securityCredentials).

export AWS_ACCESS_KEY={your_access_key}
export AWS_SECRET_KEY={your_secret_key}

Ex.


AKI[...]
DPh[...]

Test the following commands:


  • ec2-describe-instances
  • ec2-describe-volumes
  • ec2-describe-regions




1 comment:

  1. Between "export AWS_SECRET_KEY={your_secret_key}" and "Test the following commands" there are 3 lines that I don't understand.

    ReplyDelete