DescribeInstanceAttribute - Amazon Elastic Compute Cloud

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 | enclaveOptions | disableApiStop

Required: Yes

DryRun

Checks whether you have the required permissions for the operation, 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

disableApiStop

To enable the instance for AWS Stop Protection, set this parameter to true; otherwise, set it to false.

Type: AttributeBooleanValue object

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 Amazon EBS I/O.

Type: AttributeBooleanValue object

enaSupport

Indicates whether enhanced networking with ENA is enabled.

Type: AttributeBooleanValue object

enclaveOptions

To enable the instance for AWS Nitro Enclaves, set this parameter to true; otherwise, set it to false.

Type: EnclaveOptions 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 device name of the root device volume (for example, /dev/sda1).

Type: AttributeValue object

sourceDestCheck

Enable or disable source/destination checks, which ensure that the instance is either the source or the destination of any traffic that it receives. If the value is true, source/destination checks are enabled; otherwise, they are disabled. The default value is true. You must disable source/destination checks if the instance runs services such as network address translation, routing, or firewalls.

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 client error codes.

Examples

Example 1

This example lists the instance type of the specified instance.

Sample Request

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

Sample Response

<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

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

Sample Response

<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

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

Sample Response

<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: