copy_volumes
¶
copy_volumes(
*,
config_overrides: Optional[EC2ClientConfig] = None,
source_volume_id: Optional[VolumeId] = None,
iops: Optional[Integer] = None,
size: Optional[Integer] = None,
volume_type: Optional[VolumeType] = None,
dry_run: Optional[Boolean] = None,
tag_specifications: Optional[TagSpecificationList] = None,
multi_attach_enabled: Optional[Boolean] = None,
throughput: Optional[Integer] = None,
client_token: Optional[String] = None,
encrypted: Optional[Boolean] = None,
kms_key_id: Optional[KmsKeyId] = None,
) -> CopyVolumesResult
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.
Parameters:
-
source_volume_id(Optional[VolumeId], default:None) –The ID of the source EBS volume to copy.
-
iops(Optional[Integer], default:None) –The number of I/O operations per second (IOPS) to provision for the volume copy. Required for
io1andio2volumes. Optional forgp3volumes. 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,000IOPS -
io1:
100 - 64,000IOPS -
io2:
100 - 256,000IOPS
Instances built on the Nitro System can support up to 256,000 IOPS. Other instances can support up to 32,000 IOPS.
-
-
size(Optional[Integer], default:None) –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,384GiB -
gp3:
65,536GiB -
io1:
16,384GiB -
io2:
65,536GiB -
st1 and sc1:
16,384GiB -
standard:
1024GiB
-
-
volume_type(Optional[VolumeType], default:None) –The volume type for the volume copy. If not specified, the volume type defaults to
gp2. -
dry_run(Optional[Boolean], default:None) –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 isUnauthorizedOperation. -
tag_specifications(Optional[TagSpecificationList], default:None) –The tags to apply to the volume copy during creation.
-
multi_attach_enabled(Optional[Boolean], default:None) –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
io1andio2volumes only. For more information, see Amazon EBS Multi-Attach. -
throughput(Optional[Integer], default:None) –The throughput to provision for the volume copy, in MiB/s. Supported for
gp3volumes 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 - 2000MiB/s -
client_token(Optional[String], default:None) –Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see Ensure Idempotency.
-
encrypted(Optional[Boolean], default:None) –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
trueto encrypt a copy of an unencrypted source volume during the copy operation. If you setEncryptedtotruebut do not specifyKmsKeyId, the service uses the default KMS key for EBS encryption in your account. -
kms_key_id(Optional[KmsKeyId], default:None) –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
Encryptedtotruebut 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.
Raises:
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_ec2/_services/ec2.py
6766 6767 6768 6769 6770 6771 6772 6773 6774 6775 6776 6777 6778 6779 6780 6781 6782 6783 6784 6785 6786 6787 6788 6789 6790 6791 6792 6793 6794 6795 6796 6797 6798 6799 6800 6801 6802 6803 6804 6805 6806 6807 6808 6809 6810 6811 6812 6813 6814 6815 6816 6817 6818 6819 6820 6821 6822 6823 6824 6825 6826 6827 6828 6829 6830 6831 6832 6833 6834 6835 6836 6837 6838 6839 6840 6841 6842 6843 6844 6845 6846 6847 6848 6849 | |