Amazon Elastic Compute Cloud

2025/10/14 - Amazon Elastic Compute Cloud - 1 new3 updated api methods

Changes  This release adds support for creating instant, point-in-time copies of EBS volumes within the same Availability Zone

CopyVolumes (new) Link ¶

Creates a crash-consistent, point-in-time copy of an existing Amazon EBS volume within the same Availability Zone. The volume copy can be attached to an Amazon EC2 instance once it reaches the available state. For more information, see Copy an Amazon EBS volume.

See also: AWS API Documentation

Request Syntax

client.copy_volumes(
    SourceVolumeId='string',
    Iops=123,
    Size=123,
    VolumeType='standard'|'io1'|'io2'|'gp2'|'sc1'|'st1'|'gp3',
    DryRun=True|False,
    TagSpecifications=[
        {
            'ResourceType': 'capacity-reservation'|'client-vpn-endpoint'|'customer-gateway'|'carrier-gateway'|'coip-pool'|'declarative-policies-report'|'dedicated-host'|'dhcp-options'|'egress-only-internet-gateway'|'elastic-ip'|'elastic-gpu'|'export-image-task'|'export-instance-task'|'fleet'|'fpga-image'|'host-reservation'|'image'|'image-usage-report'|'import-image-task'|'import-snapshot-task'|'instance'|'instance-event-window'|'internet-gateway'|'ipam'|'ipam-pool'|'ipam-scope'|'ipv4pool-ec2'|'ipv6pool-ec2'|'key-pair'|'launch-template'|'local-gateway'|'local-gateway-route-table'|'local-gateway-virtual-interface'|'local-gateway-virtual-interface-group'|'local-gateway-route-table-vpc-association'|'local-gateway-route-table-virtual-interface-group-association'|'natgateway'|'network-acl'|'network-interface'|'network-insights-analysis'|'network-insights-path'|'network-insights-access-scope'|'network-insights-access-scope-analysis'|'outpost-lag'|'placement-group'|'prefix-list'|'replace-root-volume-task'|'reserved-instances'|'route-table'|'security-group'|'security-group-rule'|'service-link-virtual-interface'|'snapshot'|'spot-fleet-request'|'spot-instances-request'|'subnet'|'subnet-cidr-reservation'|'traffic-mirror-filter'|'traffic-mirror-session'|'traffic-mirror-target'|'transit-gateway'|'transit-gateway-attachment'|'transit-gateway-connect-peer'|'transit-gateway-multicast-domain'|'transit-gateway-policy-table'|'transit-gateway-route-table'|'transit-gateway-route-table-announcement'|'volume'|'vpc'|'vpc-endpoint'|'vpc-endpoint-connection'|'vpc-endpoint-service'|'vpc-endpoint-service-permission'|'vpc-peering-connection'|'vpn-connection'|'vpn-gateway'|'vpc-flow-log'|'capacity-reservation-fleet'|'traffic-mirror-filter-rule'|'vpc-endpoint-connection-device-type'|'verified-access-instance'|'verified-access-group'|'verified-access-endpoint'|'verified-access-policy'|'verified-access-trust-provider'|'vpn-connection-device-type'|'vpc-block-public-access-exclusion'|'route-server'|'route-server-endpoint'|'route-server-peer'|'ipam-resource-discovery'|'ipam-resource-discovery-association'|'instance-connect-endpoint'|'verified-access-endpoint-target'|'ipam-external-resource-verification-token'|'capacity-block'|'mac-modification-task',
            'Tags': [
                {
                    'Key': 'string',
                    'Value': 'string'
                },
            ]
        },
    ],
    MultiAttachEnabled=True|False,
    Throughput=123,
    ClientToken='string'
)
type SourceVolumeId:

string

param SourceVolumeId:

[REQUIRED]

The ID of the source EBS volume to copy.

type Iops:

integer

param Iops:

The number of I/O operations per second (IOPS) to provision for the volume copy. Required for io1 and io2 volumes. Optional for gp3 volumes. Omit for all other volume types. Full provisioned IOPS performance can be achieved only once the volume copy is fully initialized.

Valid ranges:

  • gp3: 3,000 ``(*default*) `` - 80,000 IOPS

  • io1: 100 - 64,000 IOPS

  • io2: 100 - 256,000 IOPS

type Size:

integer

param Size:

The size of the volume copy, in GiBs. The size must be equal to or greater than the size of the source volume. If not specified, the size defaults to the size of the source volume.

Maximum supported sizes:

  • gp2: 16,384 GiB

  • gp3: 65,536 GiB

  • io1: 16,384 GiB

  • io2: 65,536 GiB

  • st1 and sc1: 16,384 GiB

  • standard: 1024 GiB

type VolumeType:

string

param VolumeType:

The volume type for the volume copy. If not specified, the volume type defaults to gp2.

type DryRun:

boolean

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

list

param TagSpecifications:

The tags to apply to the volume copy during creation.

  • (dict) --

    The tags to apply to a resource when the resource is being created. When you specify a tag, you must specify the resource type to tag, otherwise the request will fail.

    • ResourceType (string) --

      The type of resource to tag on creation.

    • Tags (list) --

      The tags to apply to the resource.

      • (dict) --

        Describes a tag.

        • Key (string) --

          The key of the tag.

          Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws:.

        • Value (string) --

          The value of the tag.

          Constraints: Tag values are case-sensitive and accept a maximum of 256 Unicode characters.

type MultiAttachEnabled:

boolean

param MultiAttachEnabled:

Indicates whether to enable Amazon EBS Multi-Attach for the volume copy. If you enable Multi-Attach, you can attach the volume to up to 16 Nitro instances in the same Availability Zone simultaneously. Supported with io1 and io2 volumes only. For more information, see Amazon EBS Multi-Attach.

type Throughput:

integer

param Throughput:

The throughput to provision for the volume copy, in MiB/s. Supported for gp3 volumes only. Omit for all other volume types. Full provisioned throughput performance can be achieved only once the volume copy is fully initialized.

Valid Range: 125 - 2000 MiB/s

type ClientToken:

string

param ClientToken:

Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see Ensure Idempotency.

This field is autopopulated if not provided.

rtype:

dict

returns:

Response Syntax

{
    'Volumes': [
        {
            'AvailabilityZoneId': 'string',
            'OutpostArn': 'string',
            'SourceVolumeId': 'string',
            'Iops': 123,
            'Tags': [
                {
                    'Key': 'string',
                    'Value': 'string'
                },
            ],
            'VolumeType': 'standard'|'io1'|'io2'|'gp2'|'sc1'|'st1'|'gp3',
            'FastRestored': True|False,
            'MultiAttachEnabled': True|False,
            'Throughput': 123,
            'SseType': 'sse-ebs'|'sse-kms'|'none',
            'Operator': {
                'Managed': True|False,
                'Principal': 'string'
            },
            'VolumeInitializationRate': 123,
            'VolumeId': 'string',
            'Size': 123,
            'SnapshotId': 'string',
            'AvailabilityZone': 'string',
            'State': 'creating'|'available'|'in-use'|'deleting'|'deleted'|'error',
            'CreateTime': datetime(2015, 1, 1),
            'Attachments': [
                {
                    'DeleteOnTermination': True|False,
                    'AssociatedResource': 'string',
                    'InstanceOwningService': 'string',
                    'VolumeId': 'string',
                    'InstanceId': 'string',
                    'Device': 'string',
                    'State': 'attaching'|'attached'|'detaching'|'detached'|'busy',
                    'AttachTime': datetime(2015, 1, 1)
                },
            ],
            'Encrypted': True|False,
            'KmsKeyId': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    • Volumes (list) --

      Information about the volume copy.

      • (dict) --

        Describes a volume.

        • AvailabilityZoneId (string) --

          The ID of the Availability Zone for the volume.

        • OutpostArn (string) --

          The Amazon Resource Name (ARN) of the Outpost.

        • SourceVolumeId (string) --

          The ID of the source volume from which the volume copy was created. Only for volume copies.

        • Iops (integer) --

          The number of I/O operations per second (IOPS). For gp3, io1, and io2 volumes, this represents the number of IOPS that are provisioned for the volume. For gp2 volumes, this represents the baseline performance of the volume and the rate at which the volume accumulates I/O credits for bursting.

        • Tags (list) --

          Any tags assigned to the volume.

          • (dict) --

            Describes a tag.

            • Key (string) --

              The key of the tag.

              Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws:.

            • Value (string) --

              The value of the tag.

              Constraints: Tag values are case-sensitive and accept a maximum of 256 Unicode characters.

        • VolumeType (string) --

          The volume type.

        • FastRestored (boolean) --

          Indicates whether the volume was created using fast snapshot restore.

        • MultiAttachEnabled (boolean) --

          Indicates whether Amazon EBS Multi-Attach is enabled.

        • Throughput (integer) --

          The throughput that the volume supports, in MiB/s.

        • SseType (string) --

          Reserved for future use.

        • Operator (dict) --

          The service provider that manages the volume.

          • Managed (boolean) --

            If true, the resource is managed by a service provider.

          • Principal (string) --

            If managed is true, then the principal is returned. The principal is the service provider that manages the resource.

        • VolumeInitializationRate (integer) --

          The Amazon EBS Provisioned Rate for Volume Initialization (volume initialization rate) specified for the volume during creation, in MiB/s. If no volume initialization rate was specified, the value is null.

        • VolumeId (string) --

          The ID of the volume.

        • Size (integer) --

          The size of the volume, in GiBs.

        • SnapshotId (string) --

          The snapshot from which the volume was created, if applicable.

        • AvailabilityZone (string) --

          The Availability Zone for the volume.

        • State (string) --

          The volume state.

        • CreateTime (datetime) --

          The time stamp when volume creation was initiated.

        • Attachments (list) --

          Information about the volume attachments.

          • (dict) --

            Describes volume attachment details.

            • DeleteOnTermination (boolean) --

              Indicates whether the EBS volume is deleted on instance termination.

            • AssociatedResource (string) --

              The ARN of the Amazon Web Services-managed resource to which the volume is attached.

            • InstanceOwningService (string) --

              The service principal of the Amazon Web Services service that owns the underlying resource to which the volume is attached.

              This parameter is returned only for volumes that are attached to Amazon Web Services-managed resources.

            • VolumeId (string) --

              The ID of the volume.

            • InstanceId (string) --

              The ID of the instance.

              If the volume is attached to an Amazon Web Services-managed resource, this parameter returns null.

            • Device (string) --

              The device name.

              If the volume is attached to an Amazon Web Services-managed resource, this parameter returns null.

            • State (string) --

              The attachment state of the volume.

            • AttachTime (datetime) --

              The time stamp when the attachment initiated.

        • Encrypted (boolean) --

          Indicates whether the volume is encrypted.

        • KmsKeyId (string) --

          The Amazon Resource Name (ARN) of the KMS key that was used to protect the volume encryption key for the volume.

CreateVolume (updated) Link ¶
Changes (response)
{'SourceVolumeId': 'string'}

Creates an EBS volume that can be attached to an instance in the same Availability Zone.

You can create a new empty volume or restore a volume from an EBS snapshot. Any Amazon Web Services Marketplace product codes from the snapshot are propagated to the volume.

You can create encrypted volumes. Encrypted volumes must be attached to instances that support Amazon EBS encryption. Volumes that are created from encrypted snapshots are also automatically encrypted. For more information, see Amazon EBS encryption in the Amazon EBS User Guide.

You can tag your volumes during creation. For more information, see Tag your Amazon EC2 resources in the Amazon EC2 User Guide.

For more information, see Create an Amazon EBS volume in the Amazon EBS User Guide.

See also: AWS API Documentation

Request Syntax

client.create_volume(
    AvailabilityZone='string',
    AvailabilityZoneId='string',
    Encrypted=True|False,
    Iops=123,
    KmsKeyId='string',
    OutpostArn='string',
    Size=123,
    SnapshotId='string',
    VolumeType='standard'|'io1'|'io2'|'gp2'|'sc1'|'st1'|'gp3',
    TagSpecifications=[
        {
            'ResourceType': 'capacity-reservation'|'client-vpn-endpoint'|'customer-gateway'|'carrier-gateway'|'coip-pool'|'declarative-policies-report'|'dedicated-host'|'dhcp-options'|'egress-only-internet-gateway'|'elastic-ip'|'elastic-gpu'|'export-image-task'|'export-instance-task'|'fleet'|'fpga-image'|'host-reservation'|'image'|'image-usage-report'|'import-image-task'|'import-snapshot-task'|'instance'|'instance-event-window'|'internet-gateway'|'ipam'|'ipam-pool'|'ipam-scope'|'ipv4pool-ec2'|'ipv6pool-ec2'|'key-pair'|'launch-template'|'local-gateway'|'local-gateway-route-table'|'local-gateway-virtual-interface'|'local-gateway-virtual-interface-group'|'local-gateway-route-table-vpc-association'|'local-gateway-route-table-virtual-interface-group-association'|'natgateway'|'network-acl'|'network-interface'|'network-insights-analysis'|'network-insights-path'|'network-insights-access-scope'|'network-insights-access-scope-analysis'|'outpost-lag'|'placement-group'|'prefix-list'|'replace-root-volume-task'|'reserved-instances'|'route-table'|'security-group'|'security-group-rule'|'service-link-virtual-interface'|'snapshot'|'spot-fleet-request'|'spot-instances-request'|'subnet'|'subnet-cidr-reservation'|'traffic-mirror-filter'|'traffic-mirror-session'|'traffic-mirror-target'|'transit-gateway'|'transit-gateway-attachment'|'transit-gateway-connect-peer'|'transit-gateway-multicast-domain'|'transit-gateway-policy-table'|'transit-gateway-route-table'|'transit-gateway-route-table-announcement'|'volume'|'vpc'|'vpc-endpoint'|'vpc-endpoint-connection'|'vpc-endpoint-service'|'vpc-endpoint-service-permission'|'vpc-peering-connection'|'vpn-connection'|'vpn-gateway'|'vpc-flow-log'|'capacity-reservation-fleet'|'traffic-mirror-filter-rule'|'vpc-endpoint-connection-device-type'|'verified-access-instance'|'verified-access-group'|'verified-access-endpoint'|'verified-access-policy'|'verified-access-trust-provider'|'vpn-connection-device-type'|'vpc-block-public-access-exclusion'|'route-server'|'route-server-endpoint'|'route-server-peer'|'ipam-resource-discovery'|'ipam-resource-discovery-association'|'instance-connect-endpoint'|'verified-access-endpoint-target'|'ipam-external-resource-verification-token'|'capacity-block'|'mac-modification-task',
            'Tags': [
                {
                    'Key': 'string',
                    'Value': 'string'
                },
            ]
        },
    ],
    MultiAttachEnabled=True|False,
    Throughput=123,
    ClientToken='string',
    VolumeInitializationRate=123,
    Operator={
        'Principal': 'string'
    },
    DryRun=True|False
)
type AvailabilityZone:

string

param AvailabilityZone:

The ID of the Availability Zone in which to create the volume. For example, us-east-1a.

Either AvailabilityZone or AvailabilityZoneId must be specified, but not both.

type AvailabilityZoneId:

string

param AvailabilityZoneId:

The ID of the Availability Zone in which to create the volume. For example, use1-az1.

Either AvailabilityZone or AvailabilityZoneId must be specified, but not both.

type Encrypted:

boolean

param Encrypted:

Indicates whether the volume should be encrypted. The effect of setting the encryption state to true depends on the volume origin (new or from a snapshot), starting encryption state, ownership, and whether encryption by default is enabled. For more information, see Encryption by default in the Amazon EBS User Guide.

Encrypted Amazon EBS volumes must be attached to instances that support Amazon EBS encryption. For more information, see Supported instance types.

type Iops:

integer

param Iops:

The number of I/O operations per second (IOPS) to provision for the volume. Required for io1 and io2 volumes. Optional for gp3 volumes. Omit for all other volume types.

Valid ranges:

  • gp3: 3,000 ``(*default*) `` - 80,000 IOPS

  • io1: 100 - 64,000 IOPS

  • io2: 100 - 256,000 IOPS

type KmsKeyId:

string

param KmsKeyId:

The identifier of the KMS key to use for Amazon EBS encryption. If this parameter is not specified, your KMS key for Amazon EBS is used. If KmsKeyId is specified, the encrypted state must be true.

You can specify the KMS key using any of the following:

  • Key ID. For example, 1234abcd-12ab-34cd-56ef-1234567890ab.

  • Key alias. For example, alias/ExampleAlias.

  • Key ARN. For example, arn:aws:kms:us-east-1:012345678910:key/1234abcd-12ab-34cd-56ef-1234567890ab.

  • Alias ARN. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias.

Amazon Web Services authenticates the KMS key asynchronously. Therefore, if you specify an ID, alias, or ARN that is not valid, the action can appear to complete, but eventually fails.

type OutpostArn:

string

param OutpostArn:

The Amazon Resource Name (ARN) of the Outpost on which to create the volume.

If you intend to use a volume with an instance running on an outpost, then you must create the volume on the same outpost as the instance. You can't use a volume created in an Amazon Web Services Region with an instance on an Amazon Web Services outpost, or the other way around.

type Size:

integer

param Size:

The size of the volume, in GiBs. You must specify either a snapshot ID or a volume size. If you specify a snapshot, the default is the snapshot size, and you can specify a volume size that is equal to or larger than the snapshot size.

Valid sizes:

  • gp2: 1 - 16,384 GiB

  • gp3: 1 - 65,536 GiB

  • io1: 4 - 16,384 GiB

  • io2: 4 - 65,536 GiB

  • st1 and sc1: 125 - 16,384 GiB

  • standard: 1 - 1024 GiB

type SnapshotId:

string

param SnapshotId:

The snapshot from which to create the volume. You must specify either a snapshot ID or a volume size.

type VolumeType:

string

param VolumeType:

The volume type. This parameter can be one of the following values:

  • General Purpose SSD: gp2 | gp3

  • Provisioned IOPS SSD: io1 | io2

  • Throughput Optimized HDD: st1

  • Cold HDD: sc1

  • Magnetic: standard

For more information, see Amazon EBS volume types in the Amazon EBS User Guide.

Default: gp2

type TagSpecifications:

list

param TagSpecifications:

The tags to apply to the volume during creation.

  • (dict) --

    The tags to apply to a resource when the resource is being created. When you specify a tag, you must specify the resource type to tag, otherwise the request will fail.

    • ResourceType (string) --

      The type of resource to tag on creation.

    • Tags (list) --

      The tags to apply to the resource.

      • (dict) --

        Describes a tag.

        • Key (string) --

          The key of the tag.

          Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws:.

        • Value (string) --

          The value of the tag.

          Constraints: Tag values are case-sensitive and accept a maximum of 256 Unicode characters.

type MultiAttachEnabled:

boolean

param MultiAttachEnabled:

Indicates whether to enable Amazon EBS Multi-Attach. If you enable Multi-Attach, you can attach the volume to up to 16 Instances built on the Nitro System in the same Availability Zone. This parameter is supported with io1 and io2 volumes only. For more information, see Amazon EBS Multi-Attach in the Amazon EBS User Guide.

type Throughput:

integer

param Throughput:

The throughput to provision for the volume, in MiB/s. Supported for gp3 volumes only. Omit for all other volume types.

Valid Range: 125 - 2000 MiB/s

type ClientToken:

string

param ClientToken:

Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see Ensure Idempotency.

This field is autopopulated if not provided.

type VolumeInitializationRate:

integer

param VolumeInitializationRate:

Specifies the Amazon EBS Provisioned Rate for Volume Initialization (volume initialization rate), in MiB/s, at which to download the snapshot blocks from Amazon S3 to the volume. This is also known as volume initialization. Specifying a volume initialization rate ensures that the volume is initialized at a predictable and consistent rate after creation.

This parameter is supported only for volumes created from snapshots. Omit this parameter if:

  • You want to create the volume using fast snapshot restore. You must specify a snapshot that is enabled for fast snapshot restore. In this case, the volume is fully initialized at creation.

  • You want to create a volume that is initialized at the default rate.

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

Valid range: 100 - 300 MiB/s

type Operator:

dict

param Operator:

Reserved for internal use.

  • Principal (string) --

    The service provider that manages the resource.

type DryRun:

boolean

param 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.

rtype:

dict

returns:

Response Syntax

{
    'AvailabilityZoneId': 'string',
    'OutpostArn': 'string',
    'SourceVolumeId': 'string',
    'Iops': 123,
    'Tags': [
        {
            'Key': 'string',
            'Value': 'string'
        },
    ],
    'VolumeType': 'standard'|'io1'|'io2'|'gp2'|'sc1'|'st1'|'gp3',
    'FastRestored': True|False,
    'MultiAttachEnabled': True|False,
    'Throughput': 123,
    'SseType': 'sse-ebs'|'sse-kms'|'none',
    'Operator': {
        'Managed': True|False,
        'Principal': 'string'
    },
    'VolumeInitializationRate': 123,
    'VolumeId': 'string',
    'Size': 123,
    'SnapshotId': 'string',
    'AvailabilityZone': 'string',
    'State': 'creating'|'available'|'in-use'|'deleting'|'deleted'|'error',
    'CreateTime': datetime(2015, 1, 1),
    'Attachments': [
        {
            'DeleteOnTermination': True|False,
            'AssociatedResource': 'string',
            'InstanceOwningService': 'string',
            'VolumeId': 'string',
            'InstanceId': 'string',
            'Device': 'string',
            'State': 'attaching'|'attached'|'detaching'|'detached'|'busy',
            'AttachTime': datetime(2015, 1, 1)
        },
    ],
    'Encrypted': True|False,
    'KmsKeyId': 'string'
}

Response Structure

  • (dict) --

    Describes a volume.

    • AvailabilityZoneId (string) --

      The ID of the Availability Zone for the volume.

    • OutpostArn (string) --

      The Amazon Resource Name (ARN) of the Outpost.

    • SourceVolumeId (string) --

      The ID of the source volume from which the volume copy was created. Only for volume copies.

    • Iops (integer) --

      The number of I/O operations per second (IOPS). For gp3, io1, and io2 volumes, this represents the number of IOPS that are provisioned for the volume. For gp2 volumes, this represents the baseline performance of the volume and the rate at which the volume accumulates I/O credits for bursting.

    • Tags (list) --

      Any tags assigned to the volume.

      • (dict) --

        Describes a tag.

        • Key (string) --

          The key of the tag.

          Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws:.

        • Value (string) --

          The value of the tag.

          Constraints: Tag values are case-sensitive and accept a maximum of 256 Unicode characters.

    • VolumeType (string) --

      The volume type.

    • FastRestored (boolean) --

      Indicates whether the volume was created using fast snapshot restore.

    • MultiAttachEnabled (boolean) --

      Indicates whether Amazon EBS Multi-Attach is enabled.

    • Throughput (integer) --

      The throughput that the volume supports, in MiB/s.

    • SseType (string) --

      Reserved for future use.

    • Operator (dict) --

      The service provider that manages the volume.

      • Managed (boolean) --

        If true, the resource is managed by a service provider.

      • Principal (string) --

        If managed is true, then the principal is returned. The principal is the service provider that manages the resource.

    • VolumeInitializationRate (integer) --

      The Amazon EBS Provisioned Rate for Volume Initialization (volume initialization rate) specified for the volume during creation, in MiB/s. If no volume initialization rate was specified, the value is null.

    • VolumeId (string) --

      The ID of the volume.

    • Size (integer) --

      The size of the volume, in GiBs.

    • SnapshotId (string) --

      The snapshot from which the volume was created, if applicable.

    • AvailabilityZone (string) --

      The Availability Zone for the volume.

    • State (string) --

      The volume state.

    • CreateTime (datetime) --

      The time stamp when volume creation was initiated.

    • Attachments (list) --

      Information about the volume attachments.

      • (dict) --

        Describes volume attachment details.

        • DeleteOnTermination (boolean) --

          Indicates whether the EBS volume is deleted on instance termination.

        • AssociatedResource (string) --

          The ARN of the Amazon Web Services-managed resource to which the volume is attached.

        • InstanceOwningService (string) --

          The service principal of the Amazon Web Services service that owns the underlying resource to which the volume is attached.

          This parameter is returned only for volumes that are attached to Amazon Web Services-managed resources.

        • VolumeId (string) --

          The ID of the volume.

        • InstanceId (string) --

          The ID of the instance.

          If the volume is attached to an Amazon Web Services-managed resource, this parameter returns null.

        • Device (string) --

          The device name.

          If the volume is attached to an Amazon Web Services-managed resource, this parameter returns null.

        • State (string) --

          The attachment state of the volume.

        • AttachTime (datetime) --

          The time stamp when the attachment initiated.

    • Encrypted (boolean) --

      Indicates whether the volume is encrypted.

    • KmsKeyId (string) --

      The Amazon Resource Name (ARN) of the KMS key that was used to protect the volume encryption key for the volume.

DescribeVolumeStatus (updated) Link ¶
Changes (response)
{'VolumeStatuses': {'InitializationStatusDetails': {'InitializationType': {'volume-copy'}}}}

Describes the status of the specified volumes. Volume status provides the result of the checks performed on your volumes to determine events that can impair the performance of your volumes. The performance of a volume can be affected if an issue occurs on the volume's underlying host. If the volume's underlying host experiences a power outage or system issue, after the system is restored, there could be data inconsistencies on the volume. Volume events notify you if this occurs. Volume actions notify you if any action needs to be taken in response to the event.

The DescribeVolumeStatus operation provides the following information about the specified volumes:

Status: Reflects the current status of the volume. The possible values are ok, impaired , warning, or insufficient-data. If all checks pass, the overall status of the volume is ok. If the check fails, the overall status is impaired. If the status is insufficient-data, then the checks might still be taking place on your volume at the time. We recommend that you retry the request. For more information about volume status, see Monitor the status of your volumes in the Amazon EBS User Guide.

Events: Reflect the cause of a volume status and might require you to take action. For example, if your volume returns an impaired status, then the volume event might be potential-data-inconsistency. This means that your volume has been affected by an issue with the underlying host, has all I/O operations disabled, and might have inconsistent data.

Actions: Reflect the actions you might have to take in response to an event. For example, if the status of the volume is impaired and the volume event shows potential-data-inconsistency, then the action shows enable-volume-io. This means that you may want to enable the I/O operations for the volume and then check the volume for data consistency. For more information, see Work with an impaired EBS volume.

Volume status is based on the volume status checks, and does not reflect the volume state. Therefore, volume status does not indicate volumes in the error state (for example, when a volume is incapable of accepting I/O.)

See also: AWS API Documentation

Request Syntax

client.describe_volume_status(
    MaxResults=123,
    NextToken='string',
    VolumeIds=[
        'string',
    ],
    DryRun=True|False,
    Filters=[
        {
            'Name': 'string',
            'Values': [
                'string',
            ]
        },
    ]
)
type MaxResults:

integer

param MaxResults:

The maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. For more information, see Pagination.

type NextToken:

string

param NextToken:

The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.

type VolumeIds:

list

param VolumeIds:

The IDs of the volumes.

Default: Describes all your volumes.

  • (string) --

type DryRun:

boolean

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

list

param Filters:

The filters.

  • action.code - The action code for the event (for example, enable-volume-io).

  • action.description - A description of the action.

  • action.event-id - The event ID associated with the action.

  • availability-zone - The Availability Zone of the instance.

  • event.description - A description of the event.

  • event.event-id - The event ID.

  • event.event-type - The event type (for io-enabled: passed | failed; for io-performance: io-performance:degraded | io-performance:severely-degraded | io-performance:stalled).

  • event.not-after - The latest end time for the event.

  • event.not-before - The earliest start time for the event.

  • volume-status.details-name - The cause for volume-status.status ( io-enabled | io-performance).

  • volume-status.details-status - The status of volume-status.details-name (for io-enabled: passed | failed; for io-performance: normal | degraded | severely-degraded | stalled).

  • volume-status.status - The status of the volume ( ok | impaired | warning | insufficient-data).

  • (dict) --

    A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs.

    If you specify multiple filters, the filters are joined with an AND, and the request returns only results that match all of the specified filters.

    For more information, see List and filter using the CLI and API in the Amazon EC2 User Guide.

    • Name (string) --

      The name of the filter. Filter names are case-sensitive.

    • Values (list) --

      The filter values. Filter values are case-sensitive. If you specify multiple values for a filter, the values are joined with an OR, and the request returns all results that match any of the specified values.

      • (string) --

rtype:

dict

returns:

Response Syntax

{
    'NextToken': 'string',
    'VolumeStatuses': [
        {
            'Actions': [
                {
                    'Code': 'string',
                    'Description': 'string',
                    'EventId': 'string',
                    'EventType': 'string'
                },
            ],
            'AvailabilityZone': 'string',
            'OutpostArn': 'string',
            'Events': [
                {
                    'Description': 'string',
                    'EventId': 'string',
                    'EventType': 'string',
                    'NotAfter': datetime(2015, 1, 1),
                    'NotBefore': datetime(2015, 1, 1),
                    'InstanceId': 'string'
                },
            ],
            'VolumeId': 'string',
            'VolumeStatus': {
                'Details': [
                    {
                        'Name': 'io-enabled'|'io-performance'|'initialization-state',
                        'Status': 'string'
                    },
                ],
                'Status': 'ok'|'impaired'|'insufficient-data'|'warning'
            },
            'AttachmentStatuses': [
                {
                    'IoPerformance': 'string',
                    'InstanceId': 'string'
                },
            ],
            'InitializationStatusDetails': {
                'InitializationType': 'default'|'provisioned-rate'|'volume-copy',
                'Progress': 123,
                'EstimatedTimeToCompleteInSeconds': 123
            },
            'AvailabilityZoneId': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    • NextToken (string) --

      The token to include in another request to get the next page of items. This value is null when there are no more items to return.

    • VolumeStatuses (list) --

      Information about the status of the volumes.

      • (dict) --

        Describes the volume status.

        • Actions (list) --

          The details of the operation.

          • (dict) --

            Describes a volume status operation code.

            • Code (string) --

              The code identifying the operation, for example, enable-volume-io.

            • Description (string) --

              A description of the operation.

            • EventId (string) --

              The ID of the event associated with this operation.

            • EventType (string) --

              The event type associated with this operation.

        • AvailabilityZone (string) --

          The Availability Zone of the volume.

        • OutpostArn (string) --

          The Amazon Resource Name (ARN) of the Outpost.

        • Events (list) --

          A list of events associated with the volume.

          • (dict) --

            Describes a volume status event.

            • Description (string) --

              A description of the event.

            • EventId (string) --

              The ID of this event.

            • EventType (string) --

              The type of this event.

            • NotAfter (datetime) --

              The latest end time of the event.

            • NotBefore (datetime) --

              The earliest start time of the event.

            • InstanceId (string) --

              The ID of the instance associated with the event.

        • VolumeId (string) --

          The volume ID.

        • VolumeStatus (dict) --

          The volume status.

          • Details (list) --

            The details of the volume status.

            • (dict) --

              Describes a volume status.

              • Name (string) --

                The name of the volume status.

              • Status (string) --

                The intended status of the volume status.

          • Status (string) --

            The status of the volume.

        • AttachmentStatuses (list) --

          Information about the instances to which the volume is attached.

          • (dict) --

            Information about the instances to which the volume is attached.

            • IoPerformance (string) --

              The maximum IOPS supported by the attached instance.

            • InstanceId (string) --

              The ID of the attached instance.

        • InitializationStatusDetails (dict) --

          Information about the volume initialization. It can take up to 5 minutes for the volume initialization information to be updated.

          Only available for volumes created from snapshots. Not available for empty volumes created without a snapshot.

          For more information, see Initialize Amazon EBS volumes.

          • InitializationType (string) --

            The method used for volume initialization. Possible values include:

            • default - Volume initialized using the default volume initialization rate or fast snapshot restore.

            • provisioned-rate - Volume initialized using an Amazon EBS Provisioned Rate for Volume Initialization.

            • volume-copy - Volume copy initialized at the rate for volume copies.

          • Progress (integer) --

            The current volume initialization progress as a percentage (0-100). Returns 100 when volume initialization has completed.

          • EstimatedTimeToCompleteInSeconds (integer) --

            The estimated remaining time, in seconds, for volume initialization to complete. Returns 0 when volume initialization has completed.

            Only available for volumes created with Amazon EBS Provisioned Rate for Volume Initialization.

        • AvailabilityZoneId (string) --

          The ID of the Availability Zone.

DescribeVolumes (updated) Link ¶
Changes (response)
{'Volumes': {'SourceVolumeId': 'string'}}

Describes the specified EBS volumes or all of your EBS volumes.

If you are describing a long list of volumes, we recommend that you paginate the output to make the list more manageable. For more information, see Pagination.

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

See also: AWS API Documentation

Request Syntax

client.describe_volumes(
    VolumeIds=[
        'string',
    ],
    DryRun=True|False,
    Filters=[
        {
            'Name': 'string',
            'Values': [
                'string',
            ]
        },
    ],
    NextToken='string',
    MaxResults=123
)
type VolumeIds:

list

param VolumeIds:

The volume IDs. If not specified, then all volumes are included in the response.

  • (string) --

type DryRun:

boolean

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

list

param Filters:

The filters.

  • attachment.attach-time - The time stamp when the attachment initiated.

  • attachment.delete-on-termination - Whether the volume is deleted on instance termination.

  • attachment.device - The device name specified in the block device mapping (for example, /dev/sda1).

  • attachment.instance-id - The ID of the instance the volume is attached to.

  • attachment.status - The attachment state ( attaching | attached | detaching).

  • availability-zone - The Availability Zone in which the volume was created.

  • availability-zone-id - The ID of the Availability Zone in which the volume was created.

  • create-time - The time stamp when the volume was created.

  • encrypted - Indicates whether the volume is encrypted ( true | false)

  • fast-restored - Indicates whether the volume was created from a snapshot that is enabled for fast snapshot restore ( true | false).

  • multi-attach-enabled - Indicates whether the volume is enabled for Multi-Attach ( true | false)

  • operator.managed - A Boolean that indicates whether this is a managed volume.

  • operator.principal - The principal that manages the volume. Only valid for managed volumes, where managed is true.

  • size - The size of the volume, in GiB.

  • snapshot-id - The snapshot from which the volume was created.

  • status - The state of the volume ( creating | available | in-use | deleting | deleted | error).

  • tag:<key> - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value. For example, to find all resources that have a tag with the key Owner and the value TeamA, specify tag:Owner for the filter name and TeamA for the filter value.

  • tag-key - The key of a tag assigned to the resource. Use this filter to find all resources assigned a tag with a specific key, regardless of the tag value.

  • volume-id - The volume ID.

  • volume-type - The Amazon EBS volume type ( gp2 | gp3 | io1 | io2 | st1 | sc1``| ``standard)

  • (dict) --

    A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs.

    If you specify multiple filters, the filters are joined with an AND, and the request returns only results that match all of the specified filters.

    For more information, see List and filter using the CLI and API in the Amazon EC2 User Guide.

    • Name (string) --

      The name of the filter. Filter names are case-sensitive.

    • Values (list) --

      The filter values. Filter values are case-sensitive. If you specify multiple values for a filter, the values are joined with an OR, and the request returns all results that match any of the specified values.

      • (string) --

type NextToken:

string

param NextToken:

The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.

type MaxResults:

integer

param MaxResults:

The maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. For more information, see Pagination.

rtype:

dict

returns:

Response Syntax

{
    'NextToken': 'string',
    'Volumes': [
        {
            'AvailabilityZoneId': 'string',
            'OutpostArn': 'string',
            'SourceVolumeId': 'string',
            'Iops': 123,
            'Tags': [
                {
                    'Key': 'string',
                    'Value': 'string'
                },
            ],
            'VolumeType': 'standard'|'io1'|'io2'|'gp2'|'sc1'|'st1'|'gp3',
            'FastRestored': True|False,
            'MultiAttachEnabled': True|False,
            'Throughput': 123,
            'SseType': 'sse-ebs'|'sse-kms'|'none',
            'Operator': {
                'Managed': True|False,
                'Principal': 'string'
            },
            'VolumeInitializationRate': 123,
            'VolumeId': 'string',
            'Size': 123,
            'SnapshotId': 'string',
            'AvailabilityZone': 'string',
            'State': 'creating'|'available'|'in-use'|'deleting'|'deleted'|'error',
            'CreateTime': datetime(2015, 1, 1),
            'Attachments': [
                {
                    'DeleteOnTermination': True|False,
                    'AssociatedResource': 'string',
                    'InstanceOwningService': 'string',
                    'VolumeId': 'string',
                    'InstanceId': 'string',
                    'Device': 'string',
                    'State': 'attaching'|'attached'|'detaching'|'detached'|'busy',
                    'AttachTime': datetime(2015, 1, 1)
                },
            ],
            'Encrypted': True|False,
            'KmsKeyId': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    • NextToken (string) --

      The token to include in another request to get the next page of items. This value is null when there are no more items to return.

    • Volumes (list) --

      Information about the volumes.

      • (dict) --

        Describes a volume.

        • AvailabilityZoneId (string) --

          The ID of the Availability Zone for the volume.

        • OutpostArn (string) --

          The Amazon Resource Name (ARN) of the Outpost.

        • SourceVolumeId (string) --

          The ID of the source volume from which the volume copy was created. Only for volume copies.

        • Iops (integer) --

          The number of I/O operations per second (IOPS). For gp3, io1, and io2 volumes, this represents the number of IOPS that are provisioned for the volume. For gp2 volumes, this represents the baseline performance of the volume and the rate at which the volume accumulates I/O credits for bursting.

        • Tags (list) --

          Any tags assigned to the volume.

          • (dict) --

            Describes a tag.

            • Key (string) --

              The key of the tag.

              Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws:.

            • Value (string) --

              The value of the tag.

              Constraints: Tag values are case-sensitive and accept a maximum of 256 Unicode characters.

        • VolumeType (string) --

          The volume type.

        • FastRestored (boolean) --

          Indicates whether the volume was created using fast snapshot restore.

        • MultiAttachEnabled (boolean) --

          Indicates whether Amazon EBS Multi-Attach is enabled.

        • Throughput (integer) --

          The throughput that the volume supports, in MiB/s.

        • SseType (string) --

          Reserved for future use.

        • Operator (dict) --

          The service provider that manages the volume.

          • Managed (boolean) --

            If true, the resource is managed by a service provider.

          • Principal (string) --

            If managed is true, then the principal is returned. The principal is the service provider that manages the resource.

        • VolumeInitializationRate (integer) --

          The Amazon EBS Provisioned Rate for Volume Initialization (volume initialization rate) specified for the volume during creation, in MiB/s. If no volume initialization rate was specified, the value is null.

        • VolumeId (string) --

          The ID of the volume.

        • Size (integer) --

          The size of the volume, in GiBs.

        • SnapshotId (string) --

          The snapshot from which the volume was created, if applicable.

        • AvailabilityZone (string) --

          The Availability Zone for the volume.

        • State (string) --

          The volume state.

        • CreateTime (datetime) --

          The time stamp when volume creation was initiated.

        • Attachments (list) --

          Information about the volume attachments.

          • (dict) --

            Describes volume attachment details.

            • DeleteOnTermination (boolean) --

              Indicates whether the EBS volume is deleted on instance termination.

            • AssociatedResource (string) --

              The ARN of the Amazon Web Services-managed resource to which the volume is attached.

            • InstanceOwningService (string) --

              The service principal of the Amazon Web Services service that owns the underlying resource to which the volume is attached.

              This parameter is returned only for volumes that are attached to Amazon Web Services-managed resources.

            • VolumeId (string) --

              The ID of the volume.

            • InstanceId (string) --

              The ID of the instance.

              If the volume is attached to an Amazon Web Services-managed resource, this parameter returns null.

            • Device (string) --

              The device name.

              If the volume is attached to an Amazon Web Services-managed resource, this parameter returns null.

            • State (string) --

              The attachment state of the volume.

            • AttachTime (datetime) --

              The time stamp when the attachment initiated.

        • Encrypted (boolean) --

          Indicates whether the volume is encrypted.

        • KmsKeyId (string) --

          The Amazon Resource Name (ARN) of the KMS key that was used to protect the volume encryption key for the volume.