1Net::Amazon::EC2(3)   User Contributed Perl Documentation  Net::Amazon::EC2(3)
2
3
4

NAME

6       Net::Amazon::EC2 - Perl interface to the Amazon Elastic Compute Cloud
7       (EC2) environment.
8

VERSION

10       This document describes version 0.14 of Net::Amazon::EC2, released
11       February 1st, 2010. This module is coded against the Query API version
12       of the '2009-11-30' version of the EC2 API last updated December 8th,
13       2009.
14

SYNOPSIS

16        use Net::Amazon::EC2;
17
18        my $ec2 = Net::Amazon::EC2->new(
19               AWSAccessKeyId => 'PUBLIC_KEY_HERE',
20               SecretAccessKey => 'SECRET_KEY_HERE'
21        );
22
23        # Start 1 new instance from AMI: ami-XXXXXXXX
24        my $instance = $ec2->run_instances(ImageId => 'ami-XXXXXXXX', MinCount => 1, MaxCount => 1);
25
26        my $running_instances = $ec2->describe_instances;
27
28        foreach my $reservation (@$running_instances) {
29           foreach my $instance ($reservation->instances_set) {
30               print $instance->instance_id . "\n";
31           }
32        }
33
34        my $instance_id = $instance->instances_set->[0]->instance_id;
35
36        print "$instance_id\n";
37
38        # Terminate instance
39
40        my $result = $ec2->terminate_instances(InstanceId => $instance_id);
41
42       If an error occurs while communicating with EC2, the return value of
43       these methods will be a Net::Amazon::EC2::Errors object.
44

DESCRIPTION

46       This module is a Perl interface to Amazon's Elastic Compute Cloud. It
47       uses the Query API to communicate with Amazon's Web Services framework.
48

CLASS METHODS

50   new(%params)
51       This is the constructor, it will return you a Net::Amazon::EC2 object
52       to work with.  It takes these parameters:
53
54       AWSAccessKeyId (required)
55           Your AWS access key.
56
57       SecretAccessKey (required)
58           Your secret key, WARNING! don't give this out or someone will be
59           able to use your account and incur charges on your behalf.
60
61       region (optional)
62           The region to run the API requests through. The options are:
63
64           ·   us-east-1 - Nothern Virginia
65
66           ·   us-west-1 - Northern California
67
68           ·   eu-west-1 - Ireland
69
70       debug (optional)
71           A flag to turn on debugging. It is turned off by default
72

OBJECT METHODS

74   allocate_address()
75       Acquires an elastic IP address which can be associated with an instance
76       to create a movable static IP. Takes no arguments
77
78       Returns the IP address obtained.
79
80   associate_address(%params)
81       Associates an elastic IP address with an instance. It takes the
82       following arguments:
83
84       InstanceId (required)
85           The instance id you wish to associate the IP address with
86
87       PublicIp (required)
88           The IP address to associate with
89
90       Returns true if the association succeeded.
91
92   attach_volume(%params)
93       Attach a volume to an instance.
94
95       VolumeId (required)
96           The volume id you wish to attach.
97
98       InstanceId (required)
99           The instance id you wish to attach the volume to.
100
101       Device (required)
102           The device id you want the volume attached as.
103
104       Returns a Net::Amazon::EC2::Attachment object containing the resulting
105       volume status.
106
107   authorize_security_group_ingress(%params)
108       This method adds permissions to a security group.  It takes the
109       following parameters:
110
111       GroupName (required)
112           The name of the group to add security rules to.
113
114       SourceSecurityGroupName (requred when authorizing a user and group
115       together)
116           Name of the group to add access for.
117
118       SourceSecurityGroupOwnerId (required when authorizing a user and group
119       together)
120           Owner of the group to add access for.
121
122       IpProtocol (required when adding access for a CIDR)
123           IP Protocol of the rule you are adding access for (TCP, UDP, or
124           ICMP)
125
126       FromPort (required when adding access for a CIDR)
127           Beginning of port range to add access for.
128
129       ToPort (required when adding access for a CIDR)
130           End of port range to add access for.
131
132       CidrIp (required when adding access for a CIDR)
133           The CIDR IP space we are adding access for.
134
135       Adding a rule can be done in two ways: adding a source group name +
136       source group owner id, or, by Protocol + start port + end port + CIDR
137       IP.  The two are mutally exclusive.
138
139       Returns 1 if rule is added successfully.
140
141   bundle_instance(%params)
142       Bundles the Windows instance. This procedure is not applicable for
143       Linux and UNIX instances.
144
145       NOTE NOTE NOTE This is not well tested as I don't run windows instances
146
147       InstanceId (required)
148           The ID of the instance to bundle.
149
150       Storage.S3.Bucket (required)
151           The bucket in which to store the AMI. You can specify a bucket that
152           you already own or a new bucket that Amazon EC2 creates on your
153           behalf. If you specify a bucket that belongs to someone else,
154           Amazon EC2 returns an error.
155
156       Storage.S3.Prefix (required)
157           Specifies the beginning of the file name of the AMI.
158
159       Storage.S3.AWSAccessKeyId (required)
160           The Access Key ID of the owner of the Amazon S3 bucket.
161
162       Storage.S3.UploadPolicy (required)
163           An Amazon S3 upload policy that gives Amazon EC2 permission to
164           upload items into Amazon S3 on the user's behalf.
165
166       Storage.S3.UploadPolicySignature (required)
167           The signature of the Base64 encoded JSON document.
168
169           JSON Parameters: (all are required)
170
171           expiration - The expiration of the policy. Amazon recommends 12
172           hours or longer.  conditions - A list of restrictions on what can
173           be uploaded to Amazon S3. Must contain the bucket and ACL
174           conditions in this table.  bucket - The bucket to store the AMI.
175           acl - This must be set to ec2-bundle-read.
176
177       Returns a Net::Amazon::EC2::BundleInstanceResponse object
178
179   cancel_bundle_task(%params)
180       Cancels the bundle task. This procedure is not applicable for Linux and
181       UNIX instances.
182
183       BundleId (required)
184           The ID of the bundle task to cancel.
185
186       Returns a Net::Amazon::EC2::BundleInstanceResponse object
187
188   confirm_product_instance(%params)
189       Checks to see if the product code passed in is attached to the instance
190       id, taking the following parameter:
191
192       ProductCode (required)
193           The Product Code to check
194
195       InstanceId (required)
196           The Instance Id to check
197
198       Returns a Net::Amazon::EC2::ConfirmProductInstanceResponse object
199
200   create_image(%params)
201       Creates an AMI that uses an Amazon EBS root device from a "running" or
202       "stopped" instance.
203
204       AMIs that use an Amazon EBS root device boot faster than AMIs that use
205       instance stores.  They can be up to 1 TiB in size, use storage that
206       persists on instance failure, and can be stopped and started.
207
208       InstanceId (required)
209           The ID of the instance.
210
211       Name (required)
212           The name of the AMI that was provided during image creation.
213
214           Note that the image name has the following constraints:
215
216           3-128 alphanumeric characters, parenthesis, commas, slashes,
217           dashes, or underscores.
218
219       Description (optional)
220           The description of the AMI that was provided during image creation.
221
222       NoReboot (optional)
223           By default this property is set to false, which means Amazon EC2
224           attempts to cleanly shut down the instance before image creation
225           and reboots the instance afterwards. When set to true, Amazon EC2
226           does not shut down the instance before creating the image. When
227           this option is used, file system integrity on the created image
228           cannot be guaranteed.
229
230       Returns the ID of the AMI created.
231
232   create_key_pair(%params)
233       Creates a new 2048 bit key pair, taking the following parameter:
234
235       KeyName (required)
236           A name for this key. Should be unique.
237
238       Returns a Net::Amazon::EC2::KeyPair object
239
240   create_security_group(%params)
241       This method creates a new security group.  It takes the following
242       parameters:
243
244       GroupName (required)
245           The name of the new group to create.
246
247       GroupDescription (required)
248           A short description of the new group.
249
250       Returns 1 if the group creation succeeds.
251
252   create_snapshot(%params)
253       Create a snapshot of a volume. It takes the following arguments:
254
255       VolumeId (required)
256           The volume id of the volume you want to take a snapshot of.
257
258       Description (optional)
259           Description of the Amazon EBS snapshot.
260
261       Returns a Net::Amazon::EC2::Snapshot object of the newly created
262       snapshot.
263
264   create_volume(%params)
265       Creates a volume.
266
267       Size (required)
268           The size in GiB of the volume you want to create.
269
270       SnapshotId (optional)
271           The optional snapshot id to create the volume from.
272
273       AvailabilityZone (required)
274           The availability zone to create the volume in.
275
276       Returns true if the releasing succeeded.
277
278   delete_key_pair(%params)
279       This method deletes a keypair.  Takes the following parameter:
280
281       KeyName (required)
282           The name of the key to delete.
283
284       Returns 1 if the key was successfully deleted.
285
286   delete_security_group(%params)
287       This method deletes a security group.  It takes the following
288       parameter:
289
290       GroupName (required)
291           The name of the security group to delete.
292
293       Returns 1 if the delete succeeded.
294
295   delete_snapshot(%params)
296       Deletes the snapshots passed in. It takes the following arguments:
297
298       SnapshotId (required)
299           Either a scalar or array ref of snapshot id's can be passed in.
300           Will delete the corresponding snapshots.
301
302       Returns true if the deleting succeeded.
303
304   delete_volume(%params)
305       Delete a volume.
306
307       VolumeId (required)
308           The volume id you wish to delete.
309
310       Returns true if the deleting succeeded.
311
312   deregister_image(%params)
313       This method will deregister an AMI. It takes the following parameter:
314
315       ImageId (required)
316           The image id of the AMI you want to deregister.
317
318       Returns 1 if the deregistering succeeded
319
320   describe_addresses(%params)
321       This method describes the elastic addresses currently allocated and any
322       instances associated with them. It takes the following arguments:
323
324       PublicIp (optional)
325           The IP address to describe. Can be either a scalar or an array ref.
326
327       Returns an array ref of Net::Amazon::EC2::DescribeAddress objects
328
329   describe_availability_zones(%params)
330       This method describes the availability zones currently available to
331       choose from. It takes the following arguments:
332
333       ZoneName (optional)
334           The zone name to describe. Can be either a scalar or an array ref.
335
336       Returns an array ref of Net::Amazon::EC2::AvailabilityZone objects
337
338   describe_bundle_tasks(%params)
339       Describes current bundling tasks. This procedure is not applicable for
340       Linux and UNIX instances.
341
342       BundleId (optional)
343           The optional ID of the bundle task to describe.
344
345       Returns a array ref of Net::Amazon::EC2::BundleInstanceResponse objects
346
347   describe_image_attributes(%params)
348       This method pulls a list of attributes for the image id specified
349
350       ImageId (required)
351           A scalar containing the image you want to get the list of
352           attributes for.
353
354       Attribute (required)
355           A scalar containing the attribute to describe.
356
357           Valid attributes are:
358
359           launchPermission - The AMIs launch permissions.
360           ImageId - ID of the AMI for which an attribute will be described.
361           productCodes - The product code attached to the AMI.
362           kernel - Describes the ID of the kernel associated with the AMI.
363           ramdisk - Describes the ID of RAM disk associated with the AMI.
364           blockDeviceMapping - Defines native device names to use when
365           exposing virtual devices.
366           platform - Describes the operating system platform.
367
368       Returns a Net::Amazon::EC2::DescribeImageAttribute object
369
370       * NOTE: There is currently a bug in Amazon's SOAP and Query API for
371       when you try and describe the attributes: kernel, ramdisk,
372       blockDeviceMapping, or platform AWS returns an invalid response. No
373       response yet from Amazon on an ETA for getting that bug fixed.
374
375   describe_images(%params)
376       This method pulls a list of the AMIs which can be run.  The list can be
377       modified by passing in some of the following parameters:
378
379       ImageId (optional)
380           Either a scalar or an array ref can be passed in, will cause just
381           these AMIs to be 'described'
382
383       Owner (optional)
384           Either a scalar or an array ref can be passed in, will cause AMIs
385           owned by the Owner's provided will be 'described'. Pass either
386           account ids, or 'amazon' for all amazon-owned AMIs, or 'self' for
387           your own AMIs.
388
389       ExecutableBy (optional)
390           Either a scalar or an array ref can be passed in, will cause AMIs
391           executable by the account id's specified.  Or 'self' for your own
392           AMIs.
393
394       Returns an array ref of Net::Amazon::EC2::DescribeImagesResponse
395       objects
396
397   describe_instances(%params)
398       This method pulls a list of the instances which are running or were
399       just running.  The list can be modified by passing in some of the
400       following parameters:
401
402       InstanceId (optional)
403           Either a scalar or an array ref can be passed in, will cause just
404           these instances to be 'described'
405
406       Returns an array ref of Net::Amazon::EC2::ReservationInfo objects
407
408   describe_instance_attribute(%params)
409       Returns information about an attribute of an instance. Only one
410       attribute can be specified per call.
411
412       InstanceId (required)
413           The instance id we want to describe the attributes of.
414
415       Attribute (required)
416           The attribute we want to describe. Valid values are:
417
418           ·   instanceType
419
420           ·   kernel
421
422           ·   ramdisk
423
424           ·   userData
425
426           ·   disableApiTermination
427
428           ·   instanceInitiatedShutdownBehavior
429
430           ·   rootDeviceName
431
432           ·   blockDeviceMapping
433
434       Returns a Net::Amazon::EC2::DescribeInstanceAttributeResponse object
435
436   describe_key_pairs(%params)
437       This method describes the keypairs available on this account. It takes
438       the following parameter:
439
440       KeyName (optional)
441           The name of the key to be described. Can be either a scalar or an
442           array ref.
443
444       Returns an array ref of Net::Amazon::EC2::DescribeKeyPairsResponse
445       objects
446
447   describe_regions(%params)
448       Describes EC2 regions that are currently available to launch instances
449       in for this account.
450
451       RegionName (optional)
452           The name of the region(s) to be described. Can be either a scalar
453           or an array ref.
454
455       Returns an array ref of Net::Amazon::EC2::Region objects
456
457   describe_reserved_instances(%params)
458       Describes Reserved Instances that you purchased.
459
460       ReservedInstancesId (optional)
461           The reserved instance id(s) to be described. Can be either a scalar
462           or an array ref.
463
464       Returns an array ref of Net::Amazon::EC2::ReservedInstance objects
465
466   describe_reserved_instances_offerings(%params)
467       Describes Reserved Instance offerings that are available for purchase.
468       With Amazon EC2 Reserved Instances, you purchase the right to launch
469       Amazon EC2 instances for a period of time (without getting insufficient
470       capacity errors) and pay a lower usage rate for the actual time used.
471
472       ReservedInstancesOfferingId (optional)
473           ID of the Reserved Instances to describe.
474
475       InstanceType (optional)
476           The instance type on which the Reserved Instance can be used.
477
478       AvailabilityZone (optional)
479           The Availability Zone in which the Reserved Instance can be used.
480
481       ProductDescription (optional)
482           The Reserved Instance description.
483
484       Returns an array ref of Net::Amazon::EC2::ReservedInstanceOffering
485       objects
486
487   describe_security_groups(%params)
488       This method describes the security groups available to this account. It
489       takes the following parameter:
490
491       GroupName (optional)
492           The name of the security group(s) to be described. Can be either a
493           scalar or an array ref.
494
495       Returns an array ref of Net::Amazon::EC2::SecurityGroup objects
496
497   describe_snapshot_attribute(%params)
498       Describes the snapshots attributes related to the snapshot in question.
499       It takes the following arguments:
500
501       SnapshotId (optional)
502           Either a scalar or array ref of snapshot id's can be passed in. If
503           this isn't passed in it will describe the attributes of all the
504           current snapshots.
505
506       Attribute (required)
507           The attribute to describe, currently, the only valid attribute is
508           createVolumePermission.
509
510       Returns a Net::Amazon::EC2::SnapshotAttribute object.
511
512   describe_snapshots(%params)
513       Describes the snapshots available to the user. It takes the following
514       arguments:
515
516       SnapshotId (optional)
517           Either a scalar or array ref of snapshot id's can be passed in. If
518           this isn't passed in it will describe all the current snapshots.
519
520       Owner (optional)
521           The owner of the snapshot.
522
523       RestorableBy (optional)
524           A user who can create volumes from the snapshot.
525
526       Returns an array ref of Net::Amazon::EC2::Snapshot objects.
527
528   describe_volumes(%params)
529       Describes the volumes currently created. It takes the following
530       arguments:
531
532       VolumeId (optional)
533           Either a scalar or array ref of volume id's can be passed in. If
534           this isn't passed in it will describe all the current volumes.
535
536       Returns an array ref of Net::Amazon::EC2::Volume objects.
537
538   detach_volume(%params)
539       Detach a volume from an instance.
540
541       VolumeId (required)
542           The volume id you wish to detach.
543
544       InstanceId (optional)
545           The instance id you wish to detach from.
546
547       Device (optional)
548           The device the volume was attached as.
549
550       Force (optional)
551           A boolean for if to forcibly detach the volume from the instance.
552           WARNING: This can lead to data loss or a corrupted file system.
553                   Use this option only as a last resort to detach a volume
554                   from a failed instance.  The instance will not have an
555                   opportunity to flush file system caches nor file system
556                   meta data.
557
558       Returns a Net::Amazon::EC2::Attachment object containing the resulting
559       volume status.
560
561   disassociate_address(%params)
562       Disassociates an elastic IP address with an instance. It takes the
563       following arguments:
564
565       PublicIp (required)
566           The IP address to disassociate
567
568       Returns true if the disassociation succeeded.
569
570   get_console_output(%params)
571       This method gets the output from the virtual console for an instance.
572       It takes the following parameters:
573
574       InstanceId (required)
575           A scalar containing a instance id.
576
577       Returns a Net::Amazon::EC2::ConsoleOutput object.
578
579   get_password_data(%params)
580       Retrieves the encrypted administrator password for the instances
581       running Windows. This procedure is not applicable for Linux and UNIX
582       instances.
583
584       InstanceId (required)
585           The Instance Id for which to retrieve the password.
586
587       Returns a Net::Amazon::EC2::InstancePassword object
588
589   modify_image_attribute(%params)
590       This method modifies attributes of an machine image.
591
592       ImageId (required)
593           The AMI to modify the attributes of.
594
595       Attribute (required)
596           The attribute you wish to modify, right now the attributes you can
597           modify are launchPermission and productCodes
598
599       OperationType (required for launchPermission)
600           The operation you wish to perform on the attribute. Right now just
601           'add' and 'remove' are supported.
602
603       UserId (required for launchPermission)
604           User Id's you wish to add/remove from the attribute.
605
606       UserGroup (required for launchPermission)
607           Groups you wish to add/remove from the attribute.  Currently there
608           is only one User Group available 'all' for all Amazon EC2
609           customers.
610
611       ProductCode (required for productCodes)
612           Attaches a product code to the AMI. Currently only one product code
613           can be assigned to the AMI.  Once this is set it cannot be changed
614           or reset.
615
616       Returns 1 if the modification succeeds.
617
618   modify_instance_attribute(%params)
619       Modify an attribute of an instance. Only one attribute can be specified
620       per call.
621
622       InstanceId (required)
623           The instance id we want to modify the attributes of.
624
625       Attribute (required)
626           The attribute we want to modify. Valid values are:
627
628           ·   instanceType
629
630           ·   kernel
631
632           ·   ramdisk
633
634           ·   userData
635
636           ·   disableApiTermination
637
638           ·   instanceInitiatedShutdownBehavior
639
640           ·   rootDeviceName
641
642           ·   blockDeviceMapping
643
644       Value (required)
645           The value to set the attribute to.
646
647       Returns 1 if the modification succeeds.
648
649   modify_snapshot_attribute(%params)
650       This method modifies attributes of a snapshot.
651
652       SnapshotId (required)
653           The snapshot id to modify the attributes of.
654
655       UserId (optional)
656           User Id you wish to add/remove create volume permissions for.
657
658       UserGroup (optional)
659           User Id you wish to add/remove create volume permissions for. To
660           make the snapshot createable by all set the UserGroup to "all".
661
662       Attribute (required)
663           The attribute you wish to modify, right now the only attribute you
664           can modify is "CreateVolumePermission"
665
666       OperationType (required)
667           The operation you wish to perform on the attribute. Right now just
668           'add' and 'remove' are supported.
669
670       Returns 1 if the modification succeeds.
671
672   monitor_instances(%params)
673       Enables monitoring for a running instance. For more information, refer
674       to the Amazon CloudWatch Developer Guide.
675
676       InstanceId (required)
677           The instance id(s) to monitor. Can be a scalar or an array ref
678
679       Returns an array ref of Net::Amazon::EC2::MonitoredInstance objects
680
681   purchase_reserved_instances_offering(%params)
682       Purchases a Reserved Instance for use with your account. With Amazon
683       EC2 Reserved Instances, you purchase the right to launch Amazon EC2
684       instances for a period of time (without getting insufficient capacity
685       errors) and pay a lower usage rate for the actual time used.
686
687       ReservedInstancesOfferingId (required)
688           ID of the Reserved Instances to describe. Can be either a scalar or
689           an array ref.
690
691       InstanceCount (optional)
692           The number of Reserved Instances to purchase (default is 1). Can be
693           either a scalar or an array ref.
694
695           NOTE NOTE NOTE, the array ref needs to line up with the
696           InstanceCount if you want to pass that in, so that the right number
697           of instances are started of the right instance offering
698
699       Returns 1 if the reservations succeeded.
700
701   reboot_instances(%params)
702       This method reboots an instance.  It takes the following parameters:
703
704       InstanceId (required)
705           Instance Id of the instance you wish to reboot. Can be either a
706           scalar or array ref of instances to reboot.
707
708       Returns 1 if the reboot succeeded.
709
710   register_image(%params)
711       This method registers an AMI on the EC2. It takes the following
712       parameter:
713
714       imageLocation (optional)
715           The location of the AMI manifest on S3
716
717       name (required)
718           The name of the AMI that was provided during image creation.
719
720       description (optional)
721           The description of the AMI.
722
723       architecture (optional)
724           The architecture of the image. Either i386 or x86_64
725
726       kernelId (optional)
727           The ID of the kernel to select.
728
729       ramdiskId (optional)
730           The ID of the RAM disk to select. Some kernels require additional
731           drivers at launch.
732
733       rootDeviceName (optional)
734           The root device name (e.g., /dev/sda1).
735
736       blockDeviceMapping (optional)
737           This needs to be a data structure like this:
738
739           [      {           deviceName     => "/dev/sdh", (optional)
740                     virtualName    => "ephermel0", (optional)
741                     noDevice  => "/dev/sdl", (optional),
742                     ebs            => {
743                          snapshotId               => "snap-0000", (optional)
744                          volumeSize               => "20", (optional)
745                          deleteOnTermination => "false", (optional)
746                     },      },      ...  ]
747
748       Returns the image id of the new image on EC2.
749
750   release_address(%params)
751       Releases an allocated IP address. It takes the following arguments:
752
753       PublicIp (required)
754           The IP address to release
755
756       Returns true if the releasing succeeded.
757
758   reset_image_attribute(%params)
759       This method resets an attribute for an AMI to its default state (NOTE:
760       product codes cannot be reset).  It takes the following parameters:
761
762       ImageId (required)
763           The image id of the AMI you wish to reset the attributes on.
764
765       Attribute (required)
766           The attribute you want to reset.
767
768       Returns 1 if the attribute reset succeeds.
769
770   reset_instance_attribute(%params)
771       Reset an attribute of an instance. Only one attribute can be specified
772       per call.
773
774       InstanceId (required)
775           The instance id we want to reset the attributes of.
776
777       Attribute (required)
778           The attribute we want to reset. Valid values are:
779
780           ·   kernel
781
782           ·   ramdisk
783
784       Returns 1 if the reset succeeds.
785
786   reset_snapshot_attribute(%params)
787       This method resets an attribute for an snapshot to its default state.
788
789       It takes the following parameters:
790
791       SnapshotId (required)
792           The snapshot id of the snapshot you wish to reset the attributes
793           on.
794
795       Attribute (required)
796           The attribute you want to reset (currently "CreateVolumePermission"
797           is the only valid attribute).
798
799       Returns 1 if the attribute reset succeeds.
800
801   revoke_security_group_ingress(%params)
802       This method revoke permissions to a security group.  It takes the
803       following parameters:
804
805       GroupName (required)
806           The name of the group to revoke security rules from.
807
808       SourceSecurityGroupName (requred when revoking a user and group
809       together)
810           Name of the group to revoke access from.
811
812       SourceSecurityGroupOwnerId (required when revoking a user and group
813       together)
814           Owner of the group to revoke access from.
815
816       IpProtocol (required when revoking access from a CIDR)
817           IP Protocol of the rule you are revoking access from (TCP, UDP, or
818           ICMP)
819
820       FromPort (required when revoking access from a CIDR)
821           Beginning of port range to revoke access from.
822
823       ToPort (required when revoking access from a CIDR)
824           End of port range to revoke access from.
825
826       CidrIp (required when revoking access from a CIDR)
827           The CIDR IP space we are revoking access from.
828
829       Revoking a rule can be done in two ways: revoking a source group name +
830       source group owner id, or, by Protocol + start port + end port + CIDR
831       IP.  The two are mutally exclusive.
832
833       Returns 1 if rule is revoked successfully.
834
835   run_instances(%params)
836       This method will start instance(s) of AMIs on EC2. The parameters
837       indicate which AMI to instantiate and how many / what properties they
838       have:
839
840       ImageId (required)
841           The image id you want to start an instance of.
842
843       MinCount (required)
844           The minimum number of instances to start.
845
846       MaxCount (required)
847           The maximum number of instances to start.
848
849       KeyName (optional)
850           The keypair name to associate this instance with.  If omitted, will
851           use your default keypair.
852
853       SecurityGroup (optional)
854           An scalar or array ref. Will associate this instance with the group
855           names passed in.  If omitted, will be associated with the default
856           security group.
857
858       AdditionalInfo (optional)
859           Specifies additional information to make available to the
860           instance(s).
861
862       UserData (optional)
863           Optional data to pass into the instance being started.  Needs to be
864           base64 encoded.
865
866       InstanceType (optional)
867           Specifies the type of instance to start.  The options are:
868
869           m1.small (default)
870               1 EC2 Compute Unit (1 virtual core with 1 EC2 Compute Unit).
871               32-bit, 1.7GB RAM, 160GB disk
872
873           m1.large: Standard Large Instance
874               4 EC2 Compute Units (2 virtual cores with 2 EC2 Compute Units
875               each). 64-bit, 7.5GB RAM, 850GB disk
876
877           m1.xlarge: Standard Extra Large Instance
878               8 EC2 Compute Units (4 virtual cores with 2 EC2 Compute Units
879               each). 64-bit, 15GB RAM, 1690GB disk
880
881           c1.medium: High-CPU Medium Instance
882               5 EC2 Compute Units (2 virutal cores with 2.5 EC2 Compute Units
883               each). 32-bit, 1.7GB RAM, 350GB disk
884
885           c1.xlarge: High-CPU Extra Large Instance
886               20 EC2 Compute Units (8 virtual cores with 2.5 EC2 Compute
887               Units each). 64-bit, 7GB RAM, 1690GB disk
888
889           m2.2xlarge
890               13 EC2 Compute Units (4 virtual cores with 3.25 EC2 Compute
891               Units each). 64-bit, 34.2GB RAM, 850GB disk
892
893           m2.4xlarge
894               26 EC2 Compute Units (8 virtual cores with 3.25 EC2 Compute
895               Units each). 64-bit, 68.4GB RAM, 1690GB disk
896
897       Placement.AvailabilityZone (optional)
898           The availability zone you want to run the instance in
899
900       KernelId (optional)
901           The id of the kernel you want to launch the instance with
902
903       RamdiskId (optional)
904           The id of the ramdisk you want to launch the instance with
905
906       BlockDeviceMapping.VirtualName (optional)
907           This is the virtual name for a blocked device to be attached, may
908           pass in a scalar or arrayref
909
910       BlockDeviceMapping.DeviceName (optional)
911           This is the device name for a block device to be attached, may pass
912           in a scalar or arrayref
913
914       Encoding (optional)
915           The encoding.
916
917       Version (optional)
918           The version.
919
920       Monitoring.Enabled (optional)
921           Enables monitoring for this instance.
922
923       SubnetId (optional)
924           Specifies the subnet ID within which to launch the instance(s) for
925           Amazon Virtual Private Cloud.
926
927       Returns a Net::Amazon::EC2::ReservationInfo object
928
929   start_instances(%params)
930       Starts an instance that uses an Amazon EBS volume as its root device.
931
932       InstanceId (required)
933           Either a scalar or an array ref can be passed in (containing
934           instance ids to be started).
935
936       Returns an array ref of Net::Amazon::EC2::InstanceStateChange objects.
937
938   stop_instances(%params)
939       Stops an instance that uses an Amazon EBS volume as its root device.
940
941       InstanceId (required)
942           Either a scalar or an array ref can be passed in (containing
943           instance ids to be stopped).
944
945       Force (optional)
946           If set to true, forces the instance to stop. The instance will not
947           have an opportunity to flush file system caches nor file system
948           meta data. If you use this option, you must perform file system
949           check and repair procedures. This option is not recommended for
950           Windows instances.
951
952           The default is false.
953
954       Returns an array ref of Net::Amazon::EC2::InstanceStateChange objects.
955
956   terminate_instances(%params)
957       This method shuts down instance(s) passed into it. It takes the
958       following parameter:
959
960       InstanceId (required)
961           Either a scalar or an array ref can be passed in (containing
962           instance ids)
963
964       Returns an array ref of Net::Amazon::EC2::InstanceStateChange objects.
965
966   unmonitor_instances(%params)
967       Disables monitoring for a running instance. For more information, refer
968       to the Amazon CloudWatch Developer Guide.
969
970       InstanceId (required)
971           The instance id(s) to monitor. Can be a scalar or an array ref
972
973       Returns an array ref of Net::Amazon::EC2::MonitoredInstance objects
974

TESTING

976       Set AWS_ACCESS_KEY_ID and SECRET_ACCESS_KEY environment variables to
977       run the live tests.  Note: because the live tests start an instance
978       (and kill it) in both the tests and backwards compat tests there will
979       be 2 hours of machine instance usage charges (since there are 2
980       instances started) which as of February 1st, 2010 costs a total of
981       $0.17 USD
982
983       Important note about the windows-only methods.  These have not been
984       well tested as I do not run windows-based instances, so exercise
985       caution in using these.
986

TODO

988       Need to add in support for Spot Instances.
989

AUTHOR

991       Jeff Kim <cpan@chosec.com>
992

CONTRIBUTORS

994       John McCullough
995
997       Copyright (c) 2006-2010 Jeff Kim. This program is free software; you
998       can redistribute it and/or modify it under the same terms as Perl
999       itself.
1000

SEE ALSO

1002       Amazon EC2 API:
1003       <http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/>
1004
1005
1006
1007perl v5.12.0                      2010-02-02               Net::Amazon::EC2(3)
Impressum