2026/09/09 - Amazon Elastic Compute Cloud - 3 updated api methods
Changes This release adds support for sharing Amazon EBS volumes across AWS accounts using AWS Resource Access Manager (RAM). Consuming accounts can view shared volume metadata and create copies of shared volumes within the same Availability Zone, with optional re-encryption using their own KMS key.
{'Encrypted': 'boolean', 'KmsKeyId': 'string'}
Response {'Volumes': {'OwnerId': 'string', 'VolumeArn': 'string'}}
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-metering-policy'|'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'|'vpc-encryption-control'|'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'|'ipam-prefix-list-resolver'|'ipam-policy'|'ipam-prefix-list-resolver-target'|'ipam-internet-registry-association'|'secondary-interface'|'secondary-network'|'secondary-subnet'|'capacity-manager-data-export'|'vpn-concentrator'|'ipam-pool-allocation'|'capacity-reservation-cancellation-quote'|'application-status-check',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
],
MultiAttachEnabled=True|False,
Throughput=123,
ClientToken='string',
Encrypted=True|False,
KmsKeyId='string'
)
string
[REQUIRED]
The ID of the source EBS volume to copy.
integer
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
integer
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
string
The volume type for the volume copy. If not specified, the volume type defaults to gp2.
boolean
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.
list
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.
boolean
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.
integer
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
string
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.
boolean
Indicates whether to encrypt the volume copy. If the source volume is encrypted, the service always encrypts the copy regardless of this value. Set to true to encrypt a copy of an unencrypted source volume during the copy operation. If you set Encrypted to true but do not specify KmsKeyId, the service uses the default KMS key for EBS encryption in your account.
string
The identifier of the KMS key to use for encryption of the volume copy. Specify a symmetric encryption KMS key. You can specify a KMS key using the key ID, key ARN, alias name, or alias ARN. If you set Encrypted to true but do not specify this parameter, the service uses the default KMS key for EBS encryption in your account. For cross-account volume copies, this must be a KMS key in the calling account.
dict
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',
'HiddenByDefault': True|False
},
'VolumeInitializationRate': 123,
'VolumeArn': 'string',
'OwnerId': 'string',
'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',
'EbsCardIndex': 123,
'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.
HiddenByDefault (boolean) --
If true, the resource is hidden by default based on the managed resource visibility settings for the account.
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.
VolumeArn (string) --
The Amazon Resource Name (ARN) of the volume.
OwnerId (string) --
The ID of the Amazon Web Services account that owns the volume.
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.
EbsCardIndex (integer) --
The index of the EBS card. Some instance types support multiple EBS cards. The default EBS card index is 0.
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.
{'OwnerId': 'string', 'VolumeArn': '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-metering-policy'|'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'|'vpc-encryption-control'|'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'|'ipam-prefix-list-resolver'|'ipam-policy'|'ipam-prefix-list-resolver-target'|'ipam-internet-registry-association'|'secondary-interface'|'secondary-network'|'secondary-subnet'|'capacity-manager-data-export'|'vpn-concentrator'|'ipam-pool-allocation'|'capacity-reservation-cancellation-quote'|'application-status-check',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
},
],
MultiAttachEnabled=True|False,
Throughput=123,
ClientToken='string',
VolumeInitializationRate=123,
Operator={
'Principal': 'string'
},
DryRun=True|False
)
string
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.
string
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.
boolean
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.
integer
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
string
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.
string
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.
integer
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
string
The snapshot from which to create the volume. You must specify either a snapshot ID or a volume size.
string
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
list
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.
boolean
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.
integer
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
string
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.
integer
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
dict
Reserved for internal use.
Principal (string) --
The service provider that manages the resource.
boolean
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.
dict
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',
'HiddenByDefault': True|False
},
'VolumeInitializationRate': 123,
'VolumeArn': 'string',
'OwnerId': 'string',
'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',
'EbsCardIndex': 123,
'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.
HiddenByDefault (boolean) --
If true, the resource is hidden by default based on the managed resource visibility settings for the account.
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.
VolumeArn (string) --
The Amazon Resource Name (ARN) of the volume.
OwnerId (string) --
The ID of the Amazon Web Services account that owns the volume.
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.
EbsCardIndex (integer) --
The index of the EBS card. Some instance types support multiple EBS cards. The default EBS card index is 0.
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.
{'Volumes': {'OwnerId': 'string', 'VolumeArn': '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',
],
IncludeManagedResources=True|False,
DryRun=True|False,
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
NextToken='string',
MaxResults=123
)
list
The volume IDs. If not specified, then all volumes are included in the response.
(string) --
boolean
Indicates whether to include managed resources in the output. If this parameter is set to true, the output includes resources that are managed by Amazon Web Services services, even if managed resource visibility is set to hidden.
boolean
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.
list
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) --
string
The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.
integer
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.
dict
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',
'HiddenByDefault': True|False
},
'VolumeInitializationRate': 123,
'VolumeArn': 'string',
'OwnerId': 'string',
'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',
'EbsCardIndex': 123,
'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.
HiddenByDefault (boolean) --
If true, the resource is hidden by default based on the managed resource visibility settings for the account.
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.
VolumeArn (string) --
The Amazon Resource Name (ARN) of the volume.
OwnerId (string) --
The ID of the Amazon Web Services account that owns the volume.
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.
EbsCardIndex (integer) --
The index of the EBS card. Some instance types support multiple EBS cards. The default EBS card index is 0.
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.