Skip to content

EC2  >  Operations  >  export_image

export_image

Operation

export_image async

export_image(input: ExportImageInput, plugins: list[Plugin] | None = None) -> ExportImageOutput

Exports an Amazon Machine Image (AMI) to a VM file. For more information, see Exporting a VM directly from an Amazon Machine Image (AMI) in the VM Import/Export User Guide.

Parameters:

Name Type Description Default
input ExportImageInput

An instance of ExportImageInput.

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
ExportImageOutput

An instance of ExportImageOutput.

Input

ExportImageInput dataclass

Bases: _SerdeShape

Dataclass for ExportImageInput structure.

Attributes

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

Token to enable idempotency for export image requests.

This field is autopopulated if not provided.

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

A description of the image being exported. The maximum length is 255 characters.

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

The disk image format.

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.

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

The ID of the image.

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

The name of the role that grants VM Import/Export permission to export images to your Amazon S3 bucket. If this parameter is not specified, the default role is named 'vmimport'.

s3_export_location class-attribute instance-attribute
s3_export_location: ExportTaskS3LocationRequest | None = ...

The Amazon S3 bucket for the destination image. The destination bucket must exist.

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

The tags to apply to the export image task during creation.

Output

ExportImageOutput dataclass

Bases: _SerdeShape

Dataclass for ExportImageOutput structure.

Attributes

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

A description of the image being exported.

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

The disk image format for the exported image.

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

The ID of the export image task.

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

The ID of the image.

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

The percent complete of the export image 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.

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

The name of the role that grants VM Import/Export permission to export images to your Amazon S3 bucket.

s3_export_location class-attribute instance-attribute
s3_export_location: ExportTaskS3Location | None = ...

Information about the destination Amazon S3 bucket.

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

The status of the export image task. The possible values are active, completed, deleting, and deleted.

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

The status message for the export image task.

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

Any tags assigned to the export image task.