View a markdown version of this page

ModifyVolume - WorkSpaces Instances

ModifyVolume

Modifies the size, volume type, IOPS (input/output operations per second), or throughput of a volume. When you modify a volume, you must specify at least one of these parameters. You can modify a volume only after any previous modification for that volume has finished.

To track the progress of a modification, use the Amazon EC2 DescribeVolumesModifications operation. For more information, see Monitor the progress of Amazon EBS volume modifications in the Amazon EBS User Guide.

After you increase the size of a volume, you must extend the partition and file system to use the new storage capacity. For more information, see Extend the file system after resizing an Amazon EBS volume in the Amazon EBS User Guide, which covers both Linux and Windows instances.

Request Syntax

{ "ClientToken": "string", "Iops": number, "SizeInGB": number, "Throughput": number, "VolumeId": "string", "VolumeType": "string" }

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

ClientToken

Unique token to ensure idempotent volume modification, preventing duplicate volume modifications.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 64.

Pattern: [\x20-\x7E]+

Required: No

Iops

Specifies the target IOPS rate of the volume. This parameter is valid only for gp3, io1, and io2 volumes. If you don't specify IOPS and keep the same volume type, the current IOPS rate is retained.

Type: Integer

Valid Range: Minimum value of 0.

Required: No

SizeInGB

Specifies the target size of the volume, in GiB. The target size must be greater than or equal to the current size of the volume. If you don't specify a size, the current size is retained.

Type: Integer

Valid Range: Minimum value of 1. Maximum value of 16384.

Required: No

Throughput

Specifies the target throughput of the volume, in MiB/s. This parameter is valid only for gp3 volumes. If you don't specify throughput and the volume remains gp3, the current throughput is retained.

Type: Integer

Valid Range: Minimum value of 0.

Required: No

VolumeId

Specifies the identifier of the volume to modify.

Type: String

Pattern: vol-[0-9a-zA-Z]{1,63}

Required: Yes

VolumeType

Specifies the target Amazon Elastic Block Store (Amazon EBS) volume type. If you don't specify a volume type, the current volume type is retained.

Type: String

Valid Values: standard | io1 | io2 | gp2 | sc1 | st1 | gp3

Required: No

Response Syntax

{ "TargetIops": number, "TargetSize": number, "TargetThroughput": number, "TargetVolumeType": "string", "VolumeId": "string" }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

TargetIops

Specifies the target IOPS rate of the volume.

Type: Integer

Valid Range: Minimum value of 0.

TargetSize

Specifies the target size of the volume, in GiB.

Type: Integer

Valid Range: Minimum value of 0.

TargetThroughput

Specifies the target throughput of the volume, in MiB/s.

Type: Integer

Valid Range: Minimum value of 0.

TargetVolumeType

Specifies the target Amazon EBS volume type.

Type: String

Valid Values: standard | io1 | io2 | gp2 | sc1 | st1 | gp3

VolumeId

Specifies the identifier of the modified volume.

Type: String

Pattern: vol-[0-9a-zA-Z]{1,63}

Errors

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

AccessDeniedException

Indicates insufficient permissions to perform the requested action.

Message

Detailed explanation of the access denial.

HTTP Status Code: 403

ConflictException

Signals a conflict with the current state of the resource.

Message

Description of the conflict encountered.

ResourceId

Identifier of the conflicting resource.

ResourceType

Type of the conflicting resource.

HTTP Status Code: 409

InternalServerException

Indicates an unexpected server-side error occurred.

Message

Description of the internal server error.

RetryAfterSeconds

Recommended wait time before retrying the request.

HTTP Status Code: 500

ResourceNotFoundException

Indicates the requested resource could not be found.

Message

Details about the missing resource.

ResourceId

Identifier of the resource that was not found.

ResourceType

Type of the resource that was not found.

HTTP Status Code: 404

ServiceQuotaExceededException

Indicates that a service quota has been exceeded.

Message

Description of the quota limitation.

QuotaCode

Specific code for the exceeded quota.

ResourceId

Identifier of the resource related to the quota.

ResourceType

Type of resource related to the quota.

ServiceCode

Code identifying the service with the quota limitation.

HTTP Status Code: 402

ThrottlingException

Indicates the request rate has exceeded limits.

Message

Description of the throttling event.

QuotaCode

Specific code for the throttling quota.

RetryAfterSeconds

Recommended wait time before retrying the request.

ServiceCode

Code identifying the service experiencing throttling.

HTTP Status Code: 429

ValidationException

Indicates invalid input parameters in the request.

FieldList

List of fields that failed validation.

Message

Overall description of validation failures.

Reason

Specific reason for the validation failure.

HTTP Status Code: 400

VolumeModificationRateExceededException

The volume has a previous modification that is still in progress, or has reached the limit of four modifications in a rolling 24-hour period. Wait for the current modification to finish, or wait until the time indicated in the error message, and then retry the request.

Message

Specifies the reason that the modification request was rejected.

ResourceId

Specifies the identifier of the volume for which the modification request was rejected.

ResourceType

Specifies the type of the resource for which the modification request was rejected.

HTTP Status Code: 429

See Also

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