Skip to content

describe_instance_attribute async

describe_instance_attribute(
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    dry_run: Optional[Boolean] = None,
    instance_id: Optional[InstanceId] = None,
    attribute: Optional[InstanceAttributeName] = None,
) -> InstanceAttribute

Describes the specified attribute of the specified instance. You can specify only one attribute at a time. Available attributes include SQL license exemption configuration for instances registered with the SQL LE service.

Parameters:

  • dry_run (Optional[Boolean], default: None ) –

    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.

  • instance_id (Optional[InstanceId], default: None ) –

    The ID of the instance.

  • attribute (Optional[InstanceAttributeName], default: None ) –

    The instance attribute.

    Note that the enaSupport attribute is not supported.

Raises:

Examples:

To describe the block device mapping for an instance This example describes the blockDeviceMapping attribute of the specified instance.

>>> await client.describe_instance_attribute(instance_id='i-1234567890abcdef0', attribute='blockDeviceMapping')
To describe the instance type
This example describes the instance type of the specified instance.
>>> await client.describe_instance_attribute(instance_id='i-1234567890abcdef0', attribute='instanceType')
Source code in docs_src/capo_ec2/_services/async_ec2.py
async def describe_instance_attribute(
    self,
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    dry_run: Optional["capo_ec2.types.boolean.Boolean"] = None,
    instance_id: Optional["capo_ec2.types.instance_id.InstanceId"] = None,
    attribute: Optional[
        "capo_ec2.types.instance_attribute_name.InstanceAttributeName"
    ] = None,
) -> "capo_ec2.types.instance_attribute.InstanceAttribute":
    """<p>Describes the specified attribute of the specified instance. You can specify only one attribute at a time. Available attributes include SQL license exemption configuration for instances registered with the SQL LE service. </p>

    Args:
        dry_run: <p>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 <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
        instance_id: <p>The ID of the instance.</p>
        attribute: <p>The instance attribute.</p> <p>Note that the <code>enaSupport</code> attribute is not supported.</p>

    Raises:
        capo_ec2.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To describe the block device mapping for an instance
        This example describes the ``blockDeviceMapping`` attribute of the specified instance.


        >>> await client.describe_instance_attribute(instance_id='i-1234567890abcdef0', attribute='blockDeviceMapping')
        To describe the instance type
        This example describes the instance type of the specified instance.


        >>> await client.describe_instance_attribute(instance_id='i-1234567890abcdef0', attribute='instanceType')
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_ec2.types.describe_instance_attribute_request.DescribeInstanceAttributeRequest]",
    ) -> AsyncOperationResponse[
        "capo_ec2.types.instance_attribute.InstanceAttribute"
    ]:
        import capo_ec2._operations.amazon_ec2.describe_instance_attribute

        (
            output,
            http_response,
        ) = await capo_ec2._operations.amazon_ec2.describe_instance_attribute.async_describe_instance_attribute(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DescribeInstanceAttribute")
    )
    input_: capo_ec2.types.describe_instance_attribute_request.DescribeInstanceAttributeRequest = {}
    if dry_run is not None:
        input_["dry_run"] = dry_run
    if instance_id is not None:
        input_["instance_id"] = instance_id
    if attribute is not None:
        input_["attribute"] = attribute

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output