Amazon Elastic Compute Cloud
API Reference (API Version 2013-02-01)
« PreviousNext »
View the PDF for this guide.Go to the AWS Discussion Forum for this product.Did this page help you?  Yes | No |  Tell us about it...

DescribeInstanceAttribute

Description

Describes an attribute of the specified instance. You can specify only one attribute at a time. These are the available attributes:

  • instanceType—The instance type (for example, m1.small). See Available Instance Types for more information.

  • kernel—The ID of the kernel associated with the instance

  • ramdisk—The ID of the RAM disk associated with the instance

  • userData—MIME, Base64-encoded user data provided to the instance

  • disableApiTermination—Whether the instance can be terminated using the Amazon EC2 API (false means the instance can be terminated with the API)

  • instanceInitiatedShutdownBehavior—Whether the instance stops or terminates when an instance shutdown is initiated (default is stop)

  • rootDeviceName—The name of the root device volume.

  • blockDeviceMapping—The block device mapping.

  • sourceDestCheck—This attribute exists to enable a Network Address Translation (NAT) instance in a VPC to perform NAT. The attribute controls whether source/destination checking is enabled on the instance. A value of true means checking is enabled. The value must be false for the instance to perform NAT.

  • groupSet—The security groups the instance belongs to.

  • productCodes—The product codes associated with the instance. Each product code contains a product code and a type.

  • ebsOptimized—Whether the instance is optimized for EBS I/O.

Request Parameters

InstanceId

The instance ID.

Type: String

Default: None

Required: Yes

Attribute

The instance attribute.

Type: String

Default: None

Valid values: instanceType | kernel | ramdisk | userData | disableApiTermination | instanceInitiatedShutdownBehavior | rootDeviceName | blockDeviceMapping | sourceDestCheck | groupSet | productCodes | ebsOptimized

Required: Yes

Response Elements

The following elements are returned in a DescribeInstanceAttributeResponse element.

requestId

The ID of the request.

Type: xsd:string

instanceId

The ID of the instance.

Type: xsd:string

instanceType

The instance type (for example, m1.small), wrapped in a value element. See Available Instance Types for more information.

Type: xsd:string

kernel

The kernel ID, wrapped in a value element.

Type: xsd:string

ramdisk

The RAM disk ID, wrapped in a value element.

Type: xsd:string

userData

MIME, Base64-encoded user data, wrapped in a value element.

Type: xsd:string

disableApiTermination

Indicates whether the instance can be terminated through the Amazon EC2 API. The value is wrapped in a value element. A value of true means you can't terminate the instance using the API (i.e., the instance is "locked"); a value of false means you can. You must modify this attribute before you can terminate any "locked" instances using the API.

Type: xsd:boolean

instanceInitiatedShutdownBehavior

If an instance shutdown is initiated, this determines whether the instance stops or terminates. The value is wrapped in a value element.

Type: xsd:string

Valid values: stop | terminate

rootDeviceName

The name of the root device (for example, /dev/sda1), wrapped in a value element.

Type: xsd:string

blockDeviceMapping

Type: InstanceBlockDeviceMappingResponseItemType

sourceDestCheck

This attribute exists to enable a Network Address Translation (NAT) instance in a VPC to perform NAT. The attribute controls whether source/destination checking is enabled on the instance. A value of true means checking is enabled, and false means checking is disabled. The value must be false for the instance to perform NAT. For more information, see NAT Instances in the Amazon Virtual Private Cloud User Guide.

Type: xsd:boolean

groupSet

The security groups the instance belongs to. Each group's information is wrapped in an item element.

Type: GroupItemType

productCodes

A list of product codes, each one wrapped in an item element that contains a product code and a product code type.

Type: ProductCodesSetItemType

ebsOptimized

Whether the instance is optimized for EBS I/O.

Type: xsd:boolean

Examples

Example Request

This example lists the kernel ID of the i-10a64379 instance.

https://ec2.amazonaws.com/?Action=DescribeInstanceAttribute
&InstanceId=i-10a64379
&Attribute=kernel
&AUTHPARAMS

Example Response

<DescribeInstanceAttributeResponse xmlns="http://ec2.amazonaws.com/doc/2013-02-01/">
  <requestId>59dbff89-35bd-4eac-99ed-be587EXAMPLE</requestId> 
  <instanceId>i-10a64379</instanceId>
  <kernel>
    <value>aki-f70657b2</value>
  </kernel>
</DescribeInstanceAttributeResponse>