.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{ . if \nF \{ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "VM::EC2::Image 3pm" .TH VM::EC2::Image 3pm "2014-10-24" "perl v5.20.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" VM::EC2::Image \- Object describing an Amazon Machine Image (AMI) .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use VM::EC2; \& \& $ec2 = VM::EC2\->new(...); \& $image = $ec2\->describe_images(\-image_id=>\*(Aqami\-12345\*(Aq); \& \& $state = $image\->imageState; \& $owner = $image\->imageOwnerId; \& $rootdev = $image\->rootDeviceName; \& @devices = $image\->blockDeviceMapping; \& $tags = $image\->tags; \& \& @instances = $image\->run_instances(\-min_count=>10); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This object represents an Amazon Machine Image (\s-1AMI\s0), and is returned by \s-1VM::EC2\-\s0>\fIdescribe_images()\fR. In addition to methods to query the image's attributes, the \fIrun_instances()\fR method allows you to launch and configure \s-1EC2\s0 instances based on the \s-1AMI.\s0 .SH "METHODS" .IX Header "METHODS" These object methods are supported: .PP .Vb 10 \& imageId \-\- AMI ID \& imageLocation \-\- Location of the AMI \& imageState \-\- Current state of the AMI. One of "available", \& "pending" or "failed". Only "available" AMIs \& can be launched. \& imageOwnerId \-\- AWS account ID of the image owner. \& isPublic \-\- Returns true if this image has public launch \& permissions. Note that this is a Perl boolean, \& and not the string "true". \& productCodes \-\- A list of product codes associated with the image. \& architecture \-\- The architecture of the image. \& imageType \-\- The image type (machine, kernel or RAM disk). \& kernelId \-\- The kernel associated with the image. \& ramdiskId \-\- The RAM disk associated with the image. \& platform \-\- "Windows" for Windows AMIs, otherwise undef. \& sriovNetSupport \-\- Specifies whether enhanced networking is enabled. \& "simple" if enabled. \& stateReason \-\- Explanation of a "failed" imageState. This is \& a VM::EC2::Instance::State::Reason \& object. \& imageOwnerAlias \-The AWS account alias (e.g. "self") or AWS \& account ID that owns the AMI. \& name \-\- Name of the AMI provided during image creation. \& description \-\- Description of the AMI provided during image \& creation. \& rootDeviceType \-\- The root device type. One of "ebs" or \& "instance\-store". \& rootDeviceName \-\- Name of the root device, e.g. "/dev/sda1" \& blockDeviceMapping \-\- List of block devices attached to this \& image. Each element is a \& VM::EC2::BlockDevice. \& virtualizationType \-\- One of "paravirtual" or "hvm". \& hypervisor \-\- One of "ovm" or "xen" .Ve .PP In addition, the object supports the \fItags()\fR method described in VM::EC2::Generic: .PP .Vb 1 \& print "ready for production\en" if $image\->tags\->{Released}; .Ve .ie n .SS "@instances = $image\->run_instances(%args)" .el .SS "\f(CW@instances\fP = \f(CW$image\fP\->run_instances(%args)" .IX Subsection "@instances = $image->run_instances(%args)" The \fIrun_instance()\fR method will launch one or more instances based on this \s-1AMI.\s0 The method takes all the arguments recognized by \&\s-1VM::EC2\-\s0>\fIrun_instances()\fR, except for the \-image_id argument. The method returns a list of VM::EC2::Instance objects, which you may monitor periodically until they are up and running. .PP All arguments are optional. See \fIrun_instances()\fR in \s-1VM::EC2\s0 for more information. .PP .Vb 10 \& \-min_count Minimum number of instances to launch [1] \& \-max_count Maximum number of instances to launch [1] \& \-key_name Name of the keypair to use \& \-security_group_id Security group ID to use for this instance. \& Use an arrayref for multiple group IDs \& \-security_group Security group name to use for this instance. \& Use an arrayref for multiple values. \& \-user_data User data to pass to the instances. Do NOT base64 \& encode this. It will be done for you. \& \-instance_type Type of the instance to use. See below for a \& list. \& \-placement_zone The availability zone you want to launch the \& instance into. Call $ec2\->regions for a list. \& \-placement_group An existing placement group to launch the \& instance into. Applicable to cluster instances \& only. \& \-placement_tenancy Specify \*(Aqdedicated\*(Aq to launch the instance on a \& dedicated server. Only applicable for VPC \& instances. \& \-kernel_id ID of the kernel to use for the instances, \& overriding the kernel specified in the image. \& \-ramdisk_id ID of the ramdisk to use for the instances, \& overriding the ramdisk specified in the image. \& \-block_devices Specify block devices to map onto the instances, \& overriding the values specified in the image. \& This can be a scalar string or an arrayref for \& multiple mappings: \& Example: \& [\*(Aq/dev/sdb=ephemeral0\*(Aq,\*(Aq/dev/sdc=snap\-12345:80:false\*(Aq] \& \-monitoring Pass a true value to enable detailed monitoring. \& \-subnet_id ID of the subnet to launch the instance \& into. Only applicable for VPC instances. \& \-termination_protection Pass true to lock the instance so that it \& cannot be terminated using the API. Use \& modify_instance() to unset this if youu wish to \& terminate the instance later. \& \-disable_api_termination \-\- Same as above. \& \-shutdown_behavior Pass "stop" (the default) to stop the instance \& and save its disk state when "shutdown" is called \& from within the instance. Stopped instances can \& be restarted later. Pass "terminate" to \& instead terminate the instance and discard its \& state completely. \& \-instance_initiated_shutdown_behavior \-\- Same as above. \& \-private_ip_address Assign the instance to a specific IP address \& from a VPC subnet (VPC only). \& \-client_token Unique identifier that you can provide to ensure \& idempotency of the request. You can use \& $ec2\->token() to generate a suitable identifier. \& See http://docs.amazonwebservices.com/AWSEC2/ \& latest/UserGuide/Run_Instance_Idempotency.html .Ve .PP Note that after launching an instance, you may need to wait a few seconds before adding tags to it or performing other operations. .PP See \s-1VM::EC2\s0 for details. .ie n .SS "$boolean = $image\->make_public($public)" .el .SS "\f(CW$boolean\fP = \f(CW$image\fP\->make_public($public)" .IX Subsection "$boolean = $image->make_public($public)" Change the isPublic flag. Provide a true value to make the image public, a false one to make it private. .ie n .SS "$state = $image\->current_status" .el .SS "\f(CW$state\fP = \f(CW$image\fP\->current_status" .IX Subsection "$state = $image->current_status" Refreshes the object and then calls \fIimageState()\fR to return one of \&\*(L"pending\*(R", \*(L"available\*(R" or \*(L"failed.\*(R" You can use this to monitor an image_creation process in progress. .ie n .SS "@user_ids = $image\->launchPermissions" .el .SS "\f(CW@user_ids\fP = \f(CW$image\fP\->launchPermissions" .IX Subsection "@user_ids = $image->launchPermissions" Returns a list of user IDs with launch permission for this image. Note that the \s-1AWS API\s0 calls this \&\*(L"launchPermission\*(R", but this module makes it plural to emphasize that the result is a list. .ie n .SS "@user_ids = $image\->authorized_users" .el .SS "\f(CW@user_ids\fP = \f(CW$image\fP\->authorized_users" .IX Subsection "@user_ids = $image->authorized_users" The same as launchPermissions. .ie n .SS "$boolean = $image\->add_authorized_users($id1,$id2,...)" .el .SS "\f(CW$boolean\fP = \f(CW$image\fP\->add_authorized_users($id1,$id2,...)" .IX Subsection "$boolean = $image->add_authorized_users($id1,$id2,...)" .ie n .SS "$boolean = $image\->remove_authorized_users($id1,$id2,...)" .el .SS "\f(CW$boolean\fP = \f(CW$image\fP\->remove_authorized_users($id1,$id2,...)" .IX Subsection "$boolean = $image->remove_authorized_users($id1,$id2,...)" These methods add and remove user accounts which have launch permissions for the image. The result code indicates whether the list of user IDs were successfully added or removed. .ie n .SS "$boolean = $image\->add_authorized_users($id1,$id2,...)" .el .SS "\f(CW$boolean\fP = \f(CW$image\fP\->add_authorized_users($id1,$id2,...)" .IX Subsection "$boolean = $image->add_authorized_users($id1,$id2,...)" .ie n .SS "$boolean = $image\->remove_authorized_users($id1,$id2,...)" .el .SS "\f(CW$boolean\fP = \f(CW$image\fP\->remove_authorized_users($id1,$id2,...)" .IX Subsection "$boolean = $image->remove_authorized_users($id1,$id2,...)" .ie n .SS "$boolean = $image\->reset_authorized_users" .el .SS "\f(CW$boolean\fP = \f(CW$image\fP\->reset_authorized_users" .IX Subsection "$boolean = $image->reset_authorized_users" These methods add and remove user accounts which have launch permissions for the image. The result code indicates whether the list of user IDs were successfully added or removed. .PP \&\fIreset_authorized_users()\fR resets the list users authored to launch instances from this image to empty, effectively granting launch privileges to the owner only. .PP See also \fIauthorized_users()\fR. .ie n .SS "$copy = $image\->copy(\-region => $region, \-name => $name, \-description => $desc)" .el .SS "\f(CW$copy\fP = \f(CW$image\fP\->copy(\-region => \f(CW$region\fP, \-name => \f(CW$name\fP, \-description => \f(CW$desc\fP)" .IX Subsection "$copy = $image->copy(-region => $region, -name => $name, -description => $desc)" Copies the image to another region. .PP Required arguments: .PP .Vb 1 \& \-region The region to copy to .Ve .PP Optional arguments: .PP .Vb 1 \& \-name The name of the image. \& \& \-description The description of the image. \& \& \-client_token Unique identifier to ensure idempotency of the request .Ve .ie n .SS "$image\->refresh" .el .SS "\f(CW$image\fP\->refresh" .IX Subsection "$image->refresh" This method will refresh the object from \s-1AWS,\s0 updating all values to their current ones. You can call it after tagging or otherwise changing image attributes. .SH "STRING OVERLOADING" .IX Header "STRING OVERLOADING" When used in a string context, this object will interpolate the imageId. .SH "SEE ALSO" .IX Header "SEE ALSO" \&\s-1VM::EC2\s0 VM::EC2::Generic VM::EC2::BlockDevice VM::EC2::StateReason VM::EC2::Instance VM::EC2::Tag .SH "AUTHOR" .IX Header "AUTHOR" Lincoln Stein . .PP Copyright (c) 2011 Ontario Institute for Cancer Research .PP This package and its accompanying libraries is free software; you can redistribute it and/or modify it under the terms of the \s-1GPL \s0(either version 1, or at your option, any later version) or the Artistic License 2.0. Refer to \s-1LICENSE\s0 for the full license text. In addition, please see \s-1DISCLAIMER\s0.txt for disclaimers of warranty.