Skip to main content
Kinetic Community

AWS EC2 Image Retrieve

This handler returns a list of properties for the specified EC2 image.

Downloads

By downloading this file, you acknowledge that you agree to our Terms of Service

aws_ec2_image_retrieve_v1.zip

Detailed Description

The describe_images function is the base AWS::EC2 gem call we are using for
this handler and returns a multi-level hash/array nest with a top level hash key
of "imagesSet".
 
The imagesSet has the following pseudo-xml form. Elements with the <item> 
tag are array members and are referenced by numerical index.
 
All others are hash members and are references by element/key name.
 
  <imagesSet>
    <item>
      <imageId/>
      <imageLocation/>
      <imageState/>
      <imageOwnerId/>
      <isPublic/>
      <architecture/>
      <imageType/>
      <kernelId/>
      <ramdiskId/>
      <imageOwnerAlias/>
      <name/>
      <description/>
      <rootDeviceType/>
      <rootDeviceName/>
      <blockDeviceMapping>
        <item>
          <deviceName/>
          <ebs>
            <snapshotId/>
            <volumeSize/>
            <deleteOnTermination/>
          </ebs>
        </item>
      </blockDeviceMapping>
      <virtualizationType/>
      <tagSet/>
      <hypervisor/>
    </item>
  </imagesSet>
 
To retrieve the imageId, for example, simply flatten the above structure by 
removing inapplicable items
 
  <imagesSet>
    <item>
      <imageId/>
    </item>
  </imagesSet>
 
Treat items as arrays and all other members as hash keys. Doing so, we can
reference imageId value in the following manner:
 
@base_aws_object.imagesSet.item[index].imageId
 
In this handler, we are returning just the more interesting properties for an
instance. Future versions may incorporate additional properties.

Parameters

Name Description
Image ID
The image id of the EC2 image that this handler will retrieve details about

Sample Configuration

Parameter Example Configuration
Image ID  <%= @answers['Image ID'] %>

 

Authentication

 

 

This handler requires two info values for AWS authentication: Access Key ID and
the Secret Access Key. These are analogous to username and password.
 
To find authentication values from the AWS account:
 
  1. Navigate to the following URL: https://aws.amazon.com/account/
  2. Click the "Security Credentials" link (if you are not logged in, you will
     be prompted to do so).
  3. Click the "Access Credentials" link.  Here you will find a list of your
     Access Keys.
  5. Use the Access Key ID to configure the access_key_id info value of this
     handler.
  6. To retrieve the Secret Access Key, click the "Show" link next to the Access
     Key ID that will be used.
  7. Use the Secret Access Key to configure the secret_access_key info value of
     this handler.


Results

Name Description
Image Location The location of the AMI.
Image State Current state of the AMI. If the operation returns available, the image is successfully registered and available for launching.
Owner Id AWS account ID of the image owner.
isPublic Returns true if this image has public launch permissions. Returns false if it only has implicit and explicit launch permissions.
Architecture The architecture of the image.
Image Type If the instance was launched with a key pair this is the name of the key
Kernel Id The kernel associated with the image, if any. Only applicable for machine images.
Image Owner Alias The AWS account alias (e.g., amazon, self, etc.) or AWS account ID that owns the AMI.
Name The name of the AMI that was provided during image creation.
Description The description of the AMI that was provided during image creation.
Virtualization Type The type of virtualization of the AMI.
Tag Set Tags assigned to the resource. Each tag's information is wrapped in an item element.

 

Change Log

 

Version Date Description
1 05-02-2012 Initial Version