Skip to main content

export_tasks

Creates, updates, deletes, gets or lists an export_tasks resource.

Overview

Nameexport_tasks
TypeResource
Idaws.ec2.export_tasks

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
descriptionstringA description of the resource being exported.
export_task_idstringThe ID of the export task.
export_to_s3_taskstringInformation about the export task.
instance_export_detailsstringInformation about the instance to export.
statestringThe state of the export task.
status_messagestringThe status message related to the export task.
tagsstringThe tags for the export task.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_export_tasksselectregionFilter, ExportTaskIdDescribes the specified export instance tasks or all of your export instance tasks.
create_instance_export_taskinsertInstanceId, TargetEnvironment, ExportToS3, regionTagSpecification, DescriptionExports a running or stopped instance to an Amazon S3 bucket. For information about the prerequisites for your Amazon S3 bucket, supported operating systems, image formats, and known limitations for the types of instances you can export, see Exporting an instance as a VM Using VM Import/Export in the VM Import/Export User Guide.
cancel_export_taskexecExportTaskId, regionCancels an active export task. The request removes all artifacts of the export, including any partially-created Amazon S3 objects. If the export task is complete or is in the process of transferring the final disk image, the command fails and returns an error.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
ExportTaskIdstringThe ID of the export task. This is the ID returned by the CreateInstanceExportTask and ExportImage operations.
ExportToS3objectThe format and location for an export instance task.
InstanceIdstringThe ID of the instance.
TargetEnvironmentstringThe target virtualization environment.
regionstringAWS region (default: us-east-1)
DescriptionstringA description for the conversion task or the resource being exported. The maximum length is 255 characters.
ExportTaskIdarrayThe export task IDs.
Filterarraythe filters for the export tasks.
TagSpecificationarrayThe tags to apply to the export instance task during creation.

SELECT examples

Describes the specified export instance tasks or all of your export instance tasks.

SELECT
description,
export_task_id,
export_to_s3_task,
instance_export_details,
state,
status_message,
tags
FROM aws.ec2.export_tasks
WHERE region = '{{ region }}' -- required
AND Filter = '{{ Filter }}'
AND ExportTaskId = '{{ ExportTaskId }}'
;

INSERT examples

Exports a running or stopped instance to an Amazon S3 bucket. For information about the prerequisites for your Amazon S3 bucket, supported operating systems, image formats, and known limitations for the types of instances you can export, see Exporting an instance as a VM Using VM Import/Export in the VM Import/Export User Guide.

INSERT INTO aws.ec2.export_tasks (
InstanceId,
TargetEnvironment,
ExportToS3,
region,
TagSpecification,
Description
)
SELECT
'{{ InstanceId }}',
'{{ TargetEnvironment }}',
'{{ ExportToS3 }}',
'{{ region }}',
'{{ TagSpecification }}',
'{{ Description }}'
RETURNING
description,
export_task_id,
export_to_s3_task,
instance_export_details,
state,
status_message,
tags
;

Lifecycle Methods

Cancels an active export task. The request removes all artifacts of the export, including any partially-created Amazon S3 objects. If the export task is complete or is in the process of transferring the final disk image, the command fails and returns an error.

EXEC aws.ec2.export_tasks.cancel_export_task
@ExportTaskId='{{ ExportTaskId }}' --required,
@region='{{ region }}' --required
;