DescribeVolumeAttributeCommand

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

For more information about EBS volumes, see Amazon EBS volumes  in the Amazon EBS User Guide.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { EC2Client, DescribeVolumeAttributeCommand } from "@aws-sdk/client-ec2"; // ES Modules import
// const { EC2Client, DescribeVolumeAttributeCommand } = require("@aws-sdk/client-ec2"); // CommonJS import
const client = new EC2Client(config);
const input = { // DescribeVolumeAttributeRequest
  Attribute: "autoEnableIO" || "productCodes", // required
  VolumeId: "STRING_VALUE", // required
  DryRun: true || false,
};
const command = new DescribeVolumeAttributeCommand(input);
const response = await client.send(command);
// { // DescribeVolumeAttributeResult
//   AutoEnableIO: { // AttributeBooleanValue
//     Value: true || false,
//   },
//   ProductCodes: [ // ProductCodeList
//     { // ProductCode
//       ProductCodeId: "STRING_VALUE",
//       ProductCodeType: "devpay" || "marketplace",
//     },
//   ],
//   VolumeId: "STRING_VALUE",
// };

Example Usage

 There was an error loading the code editor. Retry

DescribeVolumeAttributeCommand Input

Parameter
Type
Description
Attribute
Required
VolumeAttributeName | undefined

The attribute of the volume. This parameter is required.

VolumeId
Required
string | undefined

The ID of the volume.

DryRun
boolean | undefined

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.

DescribeVolumeAttributeCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
AutoEnableIO
AttributeBooleanValue | undefined

The state of autoEnableIO attribute.

ProductCodes
ProductCode[] | undefined

A list of product codes.

VolumeId
string | undefined

The ID of the volume.

Throws

Name
Fault
Details
EC2ServiceException
Base exception class for all service exceptions from EC2 service.