Skip to content

EC2  >  Operations  >  import_snapshot

import_snapshot

Operation

import_snapshot async

import_snapshot(input: ImportSnapshotInput, plugins: list[Plugin] | None = None) -> ImportSnapshotOutput

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:

Name Type Description Default
input ImportSnapshotInput

An instance of ImportSnapshotInput.

required
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
ImportSnapshotOutput

An instance of ImportSnapshotOutput.

Input

ImportSnapshotInput dataclass

Bases: _SerdeShape

Dataclass for ImportSnapshotInput structure.

Attributes

client_data class-attribute instance-attribute
client_data: ClientData | None = ...

The client-specific data.

client_token class-attribute instance-attribute
client_token: str | None = ...

Token to enable idempotency for VM import requests.

description class-attribute instance-attribute
description: str | None = ...

The description string for the import snapshot task.

disk_container class-attribute instance-attribute
disk_container: SnapshotDiskContainer | None = ...

Information about the disk container.

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 = ...

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 class-attribute instance-attribute
kms_key_id: str | 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 KmsKeyId is specified, the Encrypted flag 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:kms namespace, followed by the Region of the key, the Amazon Web Services account ID of the key owner, the key namespace, 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:kms namespace, followed by the Region of the key, the Amazon Web Services account ID of the key owner, the alias namespace, and then the key alias. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias.

Amazon Web Services parses KmsKeyId asynchronously, 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 class-attribute instance-attribute
role_name: str | None = ...

The name of the role to use when not using the default role, 'vmimport'.

tag_specifications class-attribute instance-attribute
tag_specifications: list[TagSpecification] | None = ...

The tags to apply to the import snapshot task during creation.

Output

ImportSnapshotOutput dataclass

Bases: _SerdeShape

Dataclass for ImportSnapshotOutput structure.

Attributes

description class-attribute instance-attribute
description: str | None = ...

A description of the import snapshot task.

import_task_id class-attribute instance-attribute
import_task_id: str | None = ...

The ID of the import snapshot task.

response_metadata class-attribute instance-attribute
response_metadata: ResponseMetadata = ...

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.

snapshot_task_detail class-attribute instance-attribute
snapshot_task_detail: SnapshotTaskDetail | None = ...

Information about the import snapshot task.

tags class-attribute instance-attribute
tags: list[Tag] | None = ...

Any tags assigned to the import snapshot task.