Skip to content

create_instance_export_task async

create_instance_export_task(
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    tag_specifications: Optional[TagSpecificationList] = None,
    description: Optional[String] = None,
    instance_id: Optional[InstanceId] = None,
    target_environment: Optional[ExportEnvironment] = None,
    export_to_s3_task: Optional[ExportToS3TaskSpecification] = None,
) -> CreateInstanceExportTaskResult

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.

Parameters:

  • tag_specifications (Optional[TagSpecificationList], default: None ) –

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

  • description (Optional[String], default: None ) –

    A description for the conversion task or the resource being exported. The maximum length is 255 characters.

  • instance_id (Optional[InstanceId], default: None ) –

    The ID of the instance.

  • target_environment (Optional[ExportEnvironment], default: None ) –

    The target virtualization environment.

  • export_to_s3_task (Optional[ExportToS3TaskSpecification], default: None ) –

    The format and location for an export instance task.

Raises:

Source code in docs_src/capo_ec2/_services/async_ec2.py
async def create_instance_export_task(
    self,
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    tag_specifications: Optional[
        "capo_ec2.types.tag_specification_list.TagSpecificationList"
    ] = None,
    description: Optional["capo_ec2.types.string.String"] = None,
    instance_id: Optional["capo_ec2.types.instance_id.InstanceId"] = None,
    target_environment: Optional[
        "capo_ec2.types.export_environment.ExportEnvironment"
    ] = None,
    export_to_s3_task: Optional[
        "capo_ec2.types.export_to_s3_task_specification.ExportToS3TaskSpecification"
    ] = None,
) -> "capo_ec2.types.create_instance_export_task_result.CreateInstanceExportTaskResult":
    """<p>Exports a running or stopped instance to an Amazon S3 bucket.</p> <p>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 <a href="https://docs.aws.amazon.com/vm-import/latest/userguide/vmexport.html">Exporting an instance as a VM Using VM Import/Export</a> in the <i>VM Import/Export User Guide</i>.</p>

    Args:
        tag_specifications: <p>The tags to apply to the export instance task during creation.</p>
        description: <p>A description for the conversion task or the resource being exported. The maximum length is 255 characters.</p>
        instance_id: <p>The ID of the instance.</p>
        target_environment: <p>The target virtualization environment.</p>
        export_to_s3_task: <p>The format and location for an export instance task.</p>

    Raises:
        capo_ec2.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_ec2.types.create_instance_export_task_request.CreateInstanceExportTaskRequest]",
    ) -> AsyncOperationResponse[
        "capo_ec2.types.create_instance_export_task_result.CreateInstanceExportTaskResult"
    ]:
        import capo_ec2._operations.amazon_ec2.create_instance_export_task

        (
            output,
            http_response,
        ) = await capo_ec2._operations.amazon_ec2.create_instance_export_task.async_create_instance_export_task(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateInstanceExportTask")
    )
    input_: capo_ec2.types.create_instance_export_task_request.CreateInstanceExportTaskRequest = {}
    if tag_specifications is not None:
        input_["tag_specifications"] = tag_specifications
    if description is not None:
        input_["description"] = description
    if instance_id is not None:
        input_["instance_id"] = instance_id
    if target_environment is not None:
        input_["target_environment"] = target_environment
    if export_to_s3_task is not None:
        input_["export_to_s3_task"] = export_to_s3_task

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output