Thank you for your reply -raise_error helped alot, the code is verbatim from the module webpage, and it does compile if I just have the lines below.

my $ec2 = VM::EC2->new(-access_key => 'wew23232', -secret_key => '3232323', -endpoint=> 'http://ec2.amazonaws.com', ); #Get image my $image = $ec2->describe_images('ami-469e1d2a');

I also do have an image created and set it as the image code $ec2->describe_images('ami-469e1d2a'), but was getting an error which was solved by sync the server clock.

Now I am getting the error from the modified code

[595] No such device or address, at API call 'DescribeImages')

#!/usr/local/perl-5.23.3/perl use strict; use warnings; use VM::EC2; my $ec2 = VM::EC2->new(-access_key => 'AKIAJQc', -secret_key => 'J3jCAvb2+six', -endpoint=> 'http://ec2.amazonaws.com', -raise_error=> '1', -region=> 'sa-east-1a', ); #Get image my $image = $ec2->describe_images('ami-469e1d2a'); # get some information about the image my $architecture = $image->architecture; my $description = $image->description; my @devices = $image->blockDeviceMapping; for my $d (@devices) { print $d->deviceName,"\n"; print $d->snapshotId,"\n"; print $d->volumeSize,"\n"; }

In reply to Re: Perl AWS Error by cbtshare
in thread Perl AWS Error by cbtshare

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.