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

DescribeInstanceAttribute

Describes the specified attribute of the specified instance. You can specify only one attribute at a time. Valid attribute values are: instanceType | kernel | ramdisk | userData | disableApiTermination | instanceInitiatedShutdownBehavior | rootDeviceName | blockDeviceMapping | productCodes | sourceDestCheck | groupSet | ebsOptimized | sriovNetSupport

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 instance attribute.

Note: The enaSupport attribute is not supported at this time.

Type: String

Valid Values: instanceType | kernel | ramdisk | userData | disableApiTermination | instanceInitiatedShutdownBehavior | rootDeviceName | blockDeviceMapping | productCodes | sourceDestCheck | groupSet | ebsOptimized | sriovNetSupport | enaSupport

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

InstanceId

The ID of the instance.

Type: String

Required: Yes

Response Elements

The following elements are returned by the service.

blockDeviceMapping

The block device mapping of the instance.

Type: array of InstanceBlockDeviceMapping objects

disableApiTermination

If the value is true, you can't terminate the instance through the Amazon EC2 console, CLI, or API; otherwise, you can.

Type: AttributeBooleanValue object

ebsOptimized

Indicates whether the instance is optimized for EBS I/O.

Type: AttributeBooleanValue object

enaSupport

Indicates whether enhanced networking with ENA is enabled.

Type: AttributeBooleanValue object

groupSet

The security groups associated with the instance.

Type: array of GroupIdentifier objects

instanceId

The ID of the instance.

Type: String

instanceInitiatedShutdownBehavior

Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).

Type: AttributeValue object

instanceType

The instance type.

Type: AttributeValue object

kernel

The kernel ID.

Type: AttributeValue object

productCodes

A list of product codes.

Type: array of ProductCode objects

ramdisk

The RAM disk ID.

Type: AttributeValue object

requestId

The ID of the request.

Type: String

rootDeviceName

The name of the root device (for example, /dev/sda1 or /dev/xvda).

Type: AttributeValue object

sourceDestCheck

Indicates whether source/destination checking is enabled. A value of true means checking is enabled, and false means checking is disabled. This value must be false for a NAT instance to perform NAT.

Type: AttributeBooleanValue object

sriovNetSupport

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

Type: AttributeValue object

userData

The user data.

Type: AttributeValue object

Errors

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

Examples

Example 1

This example lists the instance type of the specified instance.

Sample Request

Copy
https://ec2.amazonaws.com/?Action=DescribeInstanceAttribute &InstanceId=i-1234567890abcdef0 &Attribute=instanceType &AUTHPARAMS

Sample Response

Copy
<DescribeInstanceAttributeResponse xmlns="http://ec2.amazonaws.com/doc/2016-11-15/"> <requestId>59dbff89-35bd-4eac-99ed-be587EXAMPLE</requestId> <instanceId>i-1234567890abcdef0</instanceId> <instanceType> <value>t1.micro</value> </instanceType> </DescribeInstanceAttributeResponse>

Example 2

This example lists the current value of the InstanceInitiatedShutdownBehavior attribute for the specified instance.

Sample Request

Copy
https://ec2.amazonaws.com/?Action=DescribeInstanceAttribute &InstanceId=i-1234567890abcdef0 &Attribute=instanceInitiatedShutdownBehavior &AUTHPARAMS

Sample Response

Copy
<DescribeInstanceAttributeResponse xmlns="http://ec2.amazonaws.com/doc/2016-11-15/"> <requestId>59dbff89-35bd-4eac-99ed-be587EXAMPLE</requestId> <instanceId>i-1234567890abcdef0</instanceId> <instanceInitiatedShutdownBehavior> <value>stop</value> </instanceInitiatedShutdownBehavior> </DescribeInstanceAttributeResponse>

Example 3

This example lists the current value of the DisableApiTermination attribute for the specified instance.

Sample Request

Copy
https://ec2.amazonaws.com/?Action=DescribeInstanceAttribute &InstanceId=i-1234567890abcdef0 &Attribute=disableApiTermination &AUTHPARAMS

Sample Response

Copy
<DescribeInstanceAttributeResponse xmlns="http://ec2.amazonaws.com/doc/2016-11-15/"> <requestId>59dbff89-35bd-4eac-99ed-be587EXAMPLE</requestId> <instanceId>i-1234567890abcdef0</instanceId> <disableApiTermination> <value>false</value> </disableApiTermination> </DescribeInstanceAttributeResponse>

See Also

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