Menu
Amazon Elastic Compute Cloud
API Reference (API Version 2016-11-15)

DescribeImageAttribute

Describes the specified attribute of the specified AMI. You can specify only one attribute at a time.

Request Parameters

The following parameters are for this specific action. For more information about required and optional parameters that are common to all actions, see Common Query Parameters.

Attribute

The AMI attribute.

Note: Depending on your account privileges, the blockDeviceMapping attribute may return a Client.AuthFailure error. If this happens, use DescribeImages to get information about the block device mapping for the AMI.

Type: String

Valid Values: description | kernel | ramdisk | launchPermission | productCodes | blockDeviceMapping | sriovNetSupport

Required: Yes

DryRun

Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Type: Boolean

Required: No

ImageId

The ID of the AMI.

Type: String

Required: Yes

Response Elements

The following elements are returned by the service.

blockDeviceMapping

One or more block device mapping entries.

Type: Array of BlockDeviceMapping objects

description

A description for the AMI.

Type: AttributeValue object

imageId

The ID of the AMI.

Type: String

kernel

The kernel ID.

Type: AttributeValue object

launchPermission

One or more launch permissions.

Type: Array of LaunchPermission objects

productCodes

One or more product codes.

Type: Array of ProductCode objects

ramdisk

The RAM disk ID.

Type: AttributeValue object

requestId

The ID of the request.

Type: String

sriovNetSupport

Indicates whether enhanced networking with the Intel 82599 Virtual Function interface is enabled.

Type: AttributeValue object

Errors

For information about the errors that are common to all actions, see Common Client Errors.

Examples

Example 1

This example lists the launch permissions for the specified AMI.

Sample Request

https://ec2.amazonaws.com/?Action=DescribeImageAttribute
&ImageId=ami-61a54008
&Attribute=launchPermission
&AUTHPARAMS

Sample Response

<DescribeImageAttributeResponse xmlns="http://ec2.amazonaws.com/doc/2016-11-15/">
   <requestId>59dbff89-35bd-4eac-99ed-be587EXAMPLE</requestId> 
   <imageId>ami-61a54008</imageId>
   <launchPermission>
      <item>
         <group>all</group>
      </item>
      <item>
         <userId>495219933132</userId>
      </item>
   </launchPermission>
</DescribeImageAttributeResponse>

Example 2

This example lists the product codes for the specified AMI.

Sample Request

https://ec2.amazonaws.com/?Action=DescribeImageAttribute
&ImageId=ami-2bb65342
&Attribute=productCodes
&AUTHPARAMS

Sample Response

<DescribeImageAttributeResponse xmlns="http://ec2.amazonaws.com/doc/2016-11-15/>
   <requestId>59dbff89-35bd-4eac-99ed-be587EXAMPLE</requestId> 
   <imageId>ami-2bb65342</imageId>
   <productCodes> 
      <item>
        <productCode>a1b2c3d4e5f6g7h8i9j10k11</productCode>
        <type>marketplace</type>
      </item> 
   </productCodes> 
</DescribeImageAttributeResponse>

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: