About this Library

What's New?

Prerequisites

Package Content

Path Overview
dist Binary distribution of library
src Source distribution of library.
third-party Binary distribution of library dependencies.
build.xml Ant build file to build the library

Quick Start

Library comes with code samples for each available service API. To get started with the library, follow these steps:
  1. Extract the amazon-ec2-2009-11-30-java-library.zip file into a working directory.
  2. Add all sources under "src" directory to your compilation path.
  3. Add all jars files under "third-party/*" directory to your classpath
  4. Edit desired sample. For example: DescribeImagesSample.java







  5. Compile and run DescribeImagesSample. You should see the output similar to the following:


  6.     DescribeImagesResponse
            DescribeImagesResult
                Image
                    ImageId
                        ami-be3adfd7
                    ImageLocation
                        ec2-public-images/fedora-8-i386-base-v1.04.manifest.xml
                    ImageState
                        available
                    KernelId
                        aki-4438dd2d
                    RamdiskId
                        ari-4538dd2c
                    ...
    
                

    Note, to see additional debugging output, adjust level of debugging in log4j.properties available in the root of the source tree.

  7. Experiment with samples. When ready, add library binary distribution to your application classpath, and use it.

Making Requests to a Different Region

To make the service call to a different region, instantiate the client with the configuration object, and pass the region-specific endpoint. For example:

    AmazonEC2Config ec2Config = new AmazonEC2Config()
    	.withServiceURL("https://eu-west-1.ec2.amazonaws.com"));        
    AmazonSimpleDB service = new AmazonEC2Client(accessKeyId, secretAccessKey, ec2Config); 

Please see the Amazon EC2 Developer Guide for a complete list of region endpoints.

Comments, Questions or Feedback

If you have any comments, questions or feedback on the library, please start discussion here.