copy_snapshot¶
Operation¶
copy_snapshot
async
¶
copy_snapshot(request: CopySnapshotInput | CopySnapshotInputDict, /, *, plugins: list[Plugin] | None = None) -> CopySnapshotOutput
copy_snapshot(*, plugins: list[Plugin] | None = None, **kwargs: Unpack[CopySnapshotInputDict]) -> CopySnapshotOutput
Creates an exact copy of an Amazon EBS snapshot.
The location of the source snapshot determines whether you can copy it or not, and the allowed destinations for the snapshot copy.
-
If the source snapshot is in a Region, you can copy it within that Region, to another Region, to an Outpost associated with that Region, or to a Local Zone in that Region.
-
If the source snapshot is in a Local Zone, you can copy it within that Local Zone, to another Local Zone in the same zone group, or to the parent Region of the Local Zone.
-
If the source snapshot is on an Outpost, you can't copy it.
When copying snapshots to a Region, the encryption outcome for the snapshot copy depends on the Amazon EBS encryption by default setting for the destination Region, the encryption status of the source snapshot, and the encryption parameters you specify in the request. For more information, see Encryption and snapshot copying.
Snapshots copied to an Outpost must be encrypted. Unencrypted snapshots are not supported on Outposts. For more information, Amazon EBS local snapshots on Outposts.
Note
Snapshots copies have an arbitrary source volume ID. Do not use this volume ID for any purpose.
For more information, see Copy an Amazon EBS snapshot in the Amazon EBS User Guide.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
plugins
|
list[Plugin] | None
|
A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations. |
None
|
Returns:
| Type | Description |
|---|---|
CopySnapshotOutput
|
An instance of |
Input¶
Pass the input fields as keyword arguments, or pass a model or dictionary as the first positional argument. Pass plugins separately as a keyword argument.
Model¶
CopySnapshotInput
dataclass
¶
Bases: _SerdeShape
Dataclass for CopySnapshotInput structure.
Attributes¶
completion_duration_minutes
class-attribute
instance-attribute
¶
completion_duration_minutes: int | None = ...
Note
Not supported when copying snapshots to or from Local Zones or Outposts.
Specify a completion duration, in 15 minute increments, to initiate a time-based snapshot copy. Time-based snapshot copy operations complete within the specified duration. For more information, see Time-based copies.
If you do not specify a value, the snapshot copy operation is completed on a best-effort basis.
description
class-attribute
instance-attribute
¶
description: str | None = ...
A description for the EBS snapshot.
destination_availability_zone
class-attribute
instance-attribute
¶
destination_availability_zone: str | None = ...
The Local Zone, for example, cn-north-1-pkx-1a to which to copy the
snapshot.
Note
Only supported when copying a snapshot to a Local Zone.
destination_outpost_arn
class-attribute
instance-attribute
¶
destination_outpost_arn: str | None = ...
The Amazon Resource Name (ARN) of the Outpost to which to copy the snapshot.
Note
Only supported when copying a snapshot to an Outpost.
For more information, see Copy snapshots from an Amazon Web Services Region to an Outpost in the Amazon EBS User Guide.
destination_region
class-attribute
instance-attribute
¶
destination_region: str | None = ...
Deprecated.
dry_run
class-attribute
instance-attribute
¶
dry_run: bool | 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 is UnauthorizedOperation.
encrypted
class-attribute
instance-attribute
¶
encrypted: bool | None = ...
To encrypt a copy of an unencrypted snapshot if encryption by default is not enabled, enable encryption using this parameter. Otherwise, omit this parameter. Copies of encrypted snapshots are encrypted, even if you omit this parameter and encryption by default is not enabled. You cannot set this parameter to false. For more information, see Amazon EBS encryption in the Amazon EBS User Guide.
kms_key_id
class-attribute
instance-attribute
¶
kms_key_id: str | None = ...
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.
source_region
class-attribute
instance-attribute
¶
source_region: str | None = ...
The ID of the Region that contains the snapshot to be copied.
source_snapshot_id
class-attribute
instance-attribute
¶
source_snapshot_id: str | None = ...
The ID of the EBS snapshot to copy.
tag_specifications
class-attribute
instance-attribute
¶
tag_specifications: list[TagSpecification] | None = ...
The tags to apply to the new snapshot.
Dictionaries¶
CopySnapshotInputDict
¶
Bases: TypedDict
Dictionary form of CopySnapshotInput.
Attributes¶
completion_duration_minutes
instance-attribute
¶
completion_duration_minutes: int | None
Note
Not supported when copying snapshots to or from Local Zones or Outposts.
Specify a completion duration, in 15 minute increments, to initiate a time-based snapshot copy. Time-based snapshot copy operations complete within the specified duration. For more information, see Time-based copies.
If you do not specify a value, the snapshot copy operation is completed on a best-effort basis.
destination_availability_zone
instance-attribute
¶
destination_availability_zone: str | None
The Local Zone, for example, cn-north-1-pkx-1a to which to copy the
snapshot.
Note
Only supported when copying a snapshot to a Local Zone.
destination_outpost_arn
instance-attribute
¶
destination_outpost_arn: str | None
The Amazon Resource Name (ARN) of the Outpost to which to copy the snapshot.
Note
Only supported when copying a snapshot to an Outpost.
For more information, see Copy snapshots from an Amazon Web Services Region to an Outpost in the Amazon EBS User Guide.
dry_run
instance-attribute
¶
dry_run: bool | 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 is UnauthorizedOperation.
encrypted
instance-attribute
¶
encrypted: bool | None
To encrypt a copy of an unencrypted snapshot if encryption by default is not enabled, enable encryption using this parameter. Otherwise, omit this parameter. Copies of encrypted snapshots are encrypted, even if you omit this parameter and encryption by default is not enabled. You cannot set this parameter to false. For more information, see Amazon EBS encryption in the Amazon EBS User Guide.
kms_key_id
instance-attribute
¶
kms_key_id: str | None
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.
source_region
instance-attribute
¶
The ID of the Region that contains the snapshot to be copied.
source_snapshot_id
instance-attribute
¶
The ID of the EBS snapshot to copy.
tag_specifications
instance-attribute
¶
tag_specifications: Sequence[TagSpecification | TagSpecificationDict] | None
The tags to apply to the new snapshot.
Output¶
CopySnapshotOutput
dataclass
¶
Bases: _SerdeShape
Dataclass for CopySnapshotOutput structure.
Attributes¶
response_metadata
class-attribute
instance-attribute
¶
Metadata about the response that produced this output. Use this to recover the request identifiers a service's support team needs in order to investigate a call. Members of the metadata are individually optional.