import_snapshot
async
¶
import_snapshot(
*,
config_overrides: Optional[AsyncEC2ClientConfig] = 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/async_ec2.py
49015 49016 49017 49018 49019 49020 49021 49022 49023 49024 49025 49026 49027 49028 49029 49030 49031 49032 49033 49034 49035 49036 49037 49038 49039 49040 49041 49042 49043 49044 49045 49046 49047 49048 49049 49050 49051 49052 49053 49054 49055 49056 49057 49058 49059 49060 49061 49062 49063 49064 49065 49066 49067 49068 49069 49070 49071 49072 49073 49074 49075 49076 49077 49078 49079 49080 49081 49082 49083 49084 49085 49086 49087 49088 49089 49090 49091 49092 49093 49094 49095 49096 49097 49098 49099 49100 49101 49102 49103 49104 49105 49106 49107 49108 49109 49110 49111 49112 49113 | |