import_snapshot
¶
import_snapshot(
*,
config_overrides: Optional[EC2ClientConfig] = None,
client_data: Optional[ClientData] = None,
client_token: Optional[String] = None,
description: Optional[String] = None,
disk_container: Optional[SnapshotDiskContainer] = None,
dry_run: Optional[Boolean] = None,
encrypted: Optional[Boolean] = None,
kms_key_id: Optional[KmsKeyId] = None,
role_name: Optional[String] = None,
tag_specifications: Optional[TagSpecificationList] = None,
) -> ImportSnapshotResult
Imports a disk into an EBS snapshot.
For more information, see Importing a disk as a snapshot using VM Import/Export in the VM Import/Export User Guide.
Parameters:
-
client_data(Optional[ClientData], default:None) –The client-specific data.
-
client_token(Optional[String], default:None) –Token to enable idempotency for VM import requests.
-
description(Optional[String], default:None) –The description string for the import snapshot task.
-
disk_container(Optional[SnapshotDiskContainer], default:None) –Information about the disk container.
-
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. -
encrypted(Optional[Boolean], default:None) –Specifies whether the destination snapshot of the imported image should be encrypted. The default KMS key for EBS is used unless you specify a non-default KMS key using
KmsKeyId. For more information, see Amazon EBS Encryption in the Amazon Elastic Compute Cloud User Guide. -
kms_key_id(Optional[KmsKeyId], default:None) –An identifier for the symmetric KMS key to use when creating the encrypted snapshot. This parameter is only required if you want to use a non-default KMS key; if this parameter is not specified, the default KMS key for EBS is used. If a
KmsKeyIdis specified, theEncryptedflag must also be set.The KMS key identifier may be provided in any of the following formats:
-
Key ID
-
Key alias
-
ARN using key ID. The ID ARN contains the
arn:aws:kmsnamespace, followed by the Region of the key, the Amazon Web Services account ID of the key owner, thekeynamespace, and then the key ID. For example, arn:aws:kms:us-east-1:012345678910:key/abcd1234-a123-456a-a12b-a123b4cd56ef. -
ARN using key alias. The alias ARN contains the
arn:aws:kmsnamespace, followed by the Region of the key, the Amazon Web Services account ID of the key owner, thealiasnamespace, and then the key alias. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias.
Amazon Web Services parses
KmsKeyIdasynchronously, meaning that the action you call may appear to complete even though you provided an invalid identifier. This action will eventually report failure.The specified KMS key must exist in the Region that the snapshot is being copied to.
Amazon EBS does not support asymmetric KMS keys.
-
-
role_name(Optional[String], default:None) –The name of the role to use when not using the default role, 'vmimport'.
-
tag_specifications(Optional[TagSpecificationList], default:None) –The tags to apply to the import snapshot task during creation.
Raises:
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_ec2/_services/ec2.py
48348 48349 48350 48351 48352 48353 48354 48355 48356 48357 48358 48359 48360 48361 48362 48363 48364 48365 48366 48367 48368 48369 48370 48371 48372 48373 48374 48375 48376 48377 48378 48379 48380 48381 48382 48383 48384 48385 48386 48387 48388 48389 48390 48391 48392 48393 48394 48395 48396 48397 48398 48399 48400 48401 48402 48403 48404 48405 48406 48407 48408 48409 48410 48411 48412 48413 48414 48415 48416 48417 48418 48419 48420 48421 48422 48423 48424 48425 48426 48427 48428 48429 48430 48431 48432 48433 48434 48435 48436 48437 48438 48439 48440 48441 48442 48443 48444 48445 | |