EC2 Command Line Tool (Windows)

Overview

Some advance AWS features are NOT available in AWS Management Console but only available with

  • EC2 AMI command line tool
  • EC2 API command line tool

Prerequisite

Java Installation

  • Download and install JAVA JDK
    http://www.oracle.com/technetwork/java/javase/downloads/index.html
    
  • SET JAVA_HOME in your WINDOWS environment
    Example: JAVA_HOME=C:\your_directory\java\jdk1.6.0_12
    
  • Test the Java installation by
    cmd> java -version
    

Create EC2 Private Key & Certificate

  • Go to http://aws.amazon.com/
  • Select Account -> Security Credentials
  • Select X.509 Certificate & Create a New Certificate
  • Download both Private Key File & Download X.509 Certificate to
    C:\eng\dev\conf\aws
    
  • SET the following in your WINDOWS environment
    EC2_PRIVATE_KEY=C:\eng\dev\conf\aws\pk-change-to-your-key-name.pem
    EC2_CERT=C:\eng\dev\conf\aws\cert-change-to-your-cert-name.pem
    

    Change the name of the file to your downloaded file

Configure EC2 Command Line Tool

  • Download the API tool from http://developer.amazonwebservices.com/connect/entry.jspa?externalID=351&categoryID=88
  • Upzip the file into C:\eng\soft\ec2
    Example: C:\eng\soft\ec2\ec2-api-tools-1.3-53907
    
  • Put the following into your WINDOWS environment
    EC2_HOME=C:\eng\soft\ec2\ec2-api-tools-1.3-53907
    
  • Add the following to the Windows System PATH
    C:\eng\soft\ec2\ec2-api-tools-1.3-53907\bin
    
  • Test
    cmd> ec2-describe-regions
    REGION  eu-west-1       ec2.eu-west-1.amazonaws.com
    REGION  us-east-1       ec2.us-east-1.amazonaws.com
    REGION  us-west-1       ec2.us-west-1.amazonaws.com
    REGION  ap-southeast-1  ec2.ap-southeast-1.amazonaws.com
    
  • Set your region for the instance in your WINDOWS environment
    EC2_URL=https://ec2.us-east-1.amazonaws.com