Skip to content

Instantly share code, notes, and snippets.

@jadeallenx
Created April 19, 2016 04:59
Show Gist options
  • Save jadeallenx/96ffed55630217f75def4f9d19aa5732 to your computer and use it in GitHub Desktop.
Save jadeallenx/96ffed55630217f75def4f9d19aa5732 to your computer and use it in GitHub Desktop.
Test case for RT#113851
use strict;
use blib;
use Test::More;
#BEGIN {
# if (! $ENV{AWS_ACCESS_KEY_ID} || ! $ENV{SECRET_ACCESS_KEY} ) {
# plan skip_all => "Set AWS_ACCESS_KEY_ID and SECRET_ACCESS_KEY environment variables to run these _LIVE_ tests (NOTE: they will incur one instance hour of costs from EC2)";
# }
# else {
# plan tests => 5;
# use_ok( 'Net::Amazon::EC2' );
# }
#};
plan tests => 3;
use_ok( 'Net::Amazon::EC2' );
my $ec2 = eval {
Net::Amazon::EC2->new(
# AWSAccessKeyId => $ENV{AWS_ACCESS_KEY_ID},
AWSAccessKeyId => 'test',
# SecretAccessKey => $ENV{SECRET_ACCESS_KEY},
SecretAccessKey => 'test',
region => 'eu-central-1',
ssl => 1,
debug => 1,
signature_version => 4,
return_errors => 1,
);
};
isa_ok($ec2, 'Net::Amazon::EC2');
my $newinstance = $ec2->run_instances(
MinCount => 1,
MaxCount => 1,
ImageId => 1,
KeyName => 'foo',
SecurityGroupId => [1],
InstanceType => 'm1.micro',
SubnetId => 42,
'BlockDeviceMapping.VirtualName' => ['ephemeral0','ephemeral1'],
'BlockDeviceMapping.DeviceName' => ['/dev/sdd','/dev/sde'],
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment