About this Library

What's New?

Prerequisites

Package Content

Directory Overview
src Source distribution of 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-2010-06-15-perl-library.zip file into a working directory.
  2. Edit desired sample. For example: src/Amazon/EC2/Samples/DescribeImagesSample.pl







  3. Run DescribeImages sample:
  4.    perl src/Amazon/EC2/Samples/DescribeImagesSample.pl
                
  5. 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
                    ...
                

  7. Experiment with samples. When ready, install library in the perl include path 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:

    my $ec2Config =  {ServiceURL => "https://eu-west-1.ec2.amazonaws.com"};
    my $ec2 = Amazon::EC2::Client->new($accessKeyId, $secretAccessKey, $ec2Config);

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

Notes

You can use alternative hash-based interface with the library. For example, instead of:

    my $request = Amazon::EC2::Model::DescribeImagesRequest->new;
    $request->setImageId("ami-be3adfd7");
    my $response = $service->describeImages($request);
        
You can write:
    my $response = $service->describeImages({ImageId => "ami-be3adfd7"});
        

Happy coding!

Comments, Questions or Feedback

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