github.com/adrian-bl/terraform@v0.7.0-rc2.0.20160705220747-de0a34fc3517/website/source/docs/providers/aws/d/ami.html.markdown (about)

     1  ---
     2  layout: "aws"
     3  page_title: "AWS: aws_ami"
     4  sidebar_current: "docs-aws-datasource-ami"
     5  description: |-
     6    Get information on a Amazon Machine Image (AMI).
     7  ---
     8  
     9  # aws\_ami
    10  
    11  Use this data source to get the ID of a registered AMI for use in other 
    12  resources.
    13  
    14  ## Example Usage
    15  
    16  ```
    17  data "aws_ami" "nat_ami" {
    18    most_recent = true
    19    executable_users = ["self"]
    20    filter {
    21      name = "owner-alias"
    22      values = ["amazon"]
    23    }
    24    filter {
    25      name = "name"
    26      values = ["amzn-ami-vpc-nat*"]
    27    }
    28    owners = ["self"]
    29  }
    30  ```
    31  
    32  ## Argument Reference
    33  
    34  * `most_recent` - (Optional) If more than one result is returned, use the most
    35  recent AMI.
    36  
    37  * `executable_users` - (Optional) Limit search to users with *explicit* launch permission on
    38   the image. Valid items are the numeric account ID or `self`.
    39  
    40  * `filter` - (Optional) One or more name/value pairs to filter off of. There are
    41  several valid keys, for a full reference, check out
    42  [describe-images in the AWS CLI reference][1].
    43  
    44  * `owners` - (Optional) Limit search to specific AMI owners. Valid items are the numeric
    45  account ID, `amazon`, or `self`.
    46  
    47  ~> **NOTE:** At least one of `executable_users`, `filter`, or `owners` must be specified.
    48  
    49  ~> **NOTE:** If more or less than a single match is returned by the search,
    50  Terraform will fail. Ensure that your search is specific enough to return
    51  a single AMI ID only, or use `most_recent` to choose the most recent one.
    52  
    53  ## Attributes Reference
    54  
    55  `id` is set to the ID of the found AMI. In addition, the following attributes
    56  are exported:
    57  
    58  ~> **NOTE:** Some values are not always set and may not be available for
    59  interpolation.
    60  
    61  * `architecture` - The OS architecture of the AMI (ie: `i368` or `x86_64`).
    62  * `block_device_mappings` - The block device mappings of the AMI.
    63    * `block_device_mappings.#.device_name` - The physical name of the device.
    64    * `block_device_mappings.#.ebs.delete_on_termination` - `true` if the EBS volume
    65      will be deleted on termination.
    66    * `block_device_mappings.#.ebs.encrypted` - `true` if the EBS volume
    67      is encrypted.
    68    * `block_device_mappings.#.ebs.encrypted` - `0` if the EBS volume
    69      not a provisioned IOPS image, otherwise the supported IOPS count.
    70    * `block_device_mappings.#.ebs.snapshot_id` - The ID of the snapshot.
    71    * `block_device_mappings.#.ebs.volume_size` - The size of the volume, in GiB.
    72    * `block_device_mappings.#.ebs.volume_type` - The volume type.
    73    * `block_device_mappings.#.no_device` - Suppresses the specified device
    74      included in the block device mapping of the AMI.
    75    * `block_device_mappings.#.virtual_name` - The virtual device name (for
    76      instance stores).
    77  * `creation_date` - The date and time the image was created.
    78  * `description` - The description of the AMI that was provided during image
    79    creation.
    80  * `hypervisor` - The hypervisor type of the image.
    81  * `image_id` - The ID of the AMI. Should be the same as the resource `id`.
    82  * `image_location` - The location of the AMI.
    83  * `image_owner_alias` - The AWS account alias (for example, `amazon`, `self`) or
    84    the AWS account ID of the AMI owner.
    85  * `image_type` - The type of image.
    86  * `kernel_id` - The kernel associated with the image, if any. Only applicable
    87    for machine images.
    88  * `name` - The name of the AMI that was provided during image creation.
    89  * `owner_id` - The AWS account ID of the image owner.
    90  * `platform` - The value is Windows for `Windows` AMIs; otherwise blank.
    91  * `product_codes` - Any product codes associated with the AMI.
    92    * `product_codes.#.product_code_id` - The product code.
    93    * `product_codes.#.product_code_type` - The type of product code.
    94  * `public` - `true` if the image has public launch permissions.
    95  * `ramdisk_id` - The RAM disk associated with the image, if any. Only applicable
    96    for machine images.
    97  * `root_device_name` - The device name of the root device.
    98  * `root_device_type` - The type of root device (ie: `ebs` or `instance-store`).
    99  * `sriov_net_support` - Specifies whether enhanced networking is enabled.
   100  * `state` - The current state of the AMI. If the state is `available`, the image
   101    is successfully registered and can be used to launch an instance.
   102  * `state_reason` - Describes a state change. Fields are `UNSET` if not available.
   103    * `state_reason.code` - The reason code for the state change.
   104    * `state_reason.message` - The message for the state change.
   105  * `tags` - Any tags assigned to the image.
   106    * `tags.#.key` - The key name of the tag.
   107    * `tags.#.value` - The value of the tag.
   108  * `virtualization_type` - The type of virtualization of the AMI (ie: `hvm` or
   109    `paravirtual`).
   110  
   111  [1]: http://docs.aws.amazon.com/cli/latest/reference/ec2/describe-images.html