Skip to content

import_workspace_image

import_workspace_image(
    ec2_image_id: Ec2ImageId,
    ingestion_process: WorkspaceImageIngestionProcess,
    image_name: WorkspaceImageName,
    image_description: WorkspaceImageDescription,
    *,
    config_overrides: Optional[WorkSpacesClientConfig] = None,
    tags: Optional[TagList] = None,
    applications: Optional[ApplicationList] = None,
) -> ImportWorkspaceImageResult

Imports the specified Windows 10 or 11 Bring Your Own License (BYOL) image into Amazon WorkSpaces. The image must be an already licensed Amazon EC2 image that is in your Amazon Web Services account, and you must own the image. For more information about creating BYOL images, see Bring Your Own Windows Desktop Licenses.

Parameters:

  • ec2_image_id (Ec2ImageId) –

    The identifier of the EC2 image.

  • ingestion_process (WorkspaceImageIngestionProcess) –

    The ingestion process to be used when importing the image, depending on which protocol you want to use for your BYOL Workspace image, either PCoIP, WSP, or bring your own protocol (BYOP). To use DCV, specify a value that ends in _WSP. To use PCoIP, specify a value that does not end in _WSP. To use BYOP, specify a value that ends in _BYOP.

    For non-GPU-enabled bundles (bundles other than Graphics or GraphicsPro), specify BYOL_REGULAR, BYOL_REGULAR_WSP, or BYOL_REGULAR_BYOP, depending on the protocol.

    The BYOL_REGULAR_BYOP and BYOL_GRAPHICS_G4DN_BYOP values are only supported by Amazon WorkSpaces Core. Contact your account team to be allow-listed to use these values. For more information, see Amazon WorkSpaces Core.

  • image_name (WorkspaceImageName) –

    The name of the WorkSpace image.

  • image_description (WorkspaceImageDescription) –

    The description of the WorkSpace image.

  • tags (Optional[TagList], default: None ) –

    The tags. Each WorkSpaces resource can have a maximum of 50 tags.

  • applications (Optional[ApplicationList], default: None ) –

    If specified, the version of Microsoft Office to subscribe to. Valid only for Windows 10 and 11 BYOL images. For more information about subscribing to Office for BYOL images, see Bring Your Own Windows Desktop Licenses.

    • Although this parameter is an array, only one item is allowed at this time.

    • During the image import process, non-GPU DCV (formerly WSP) WorkSpaces with Windows 11 support only Microsoft_Office_2019. GPU DCV (formerly WSP) WorkSpaces with Windows 11 do not support Office installation.

Raises:

Source code in docs_src/capo_workspaces/_services/work_spaces.py
def import_workspace_image(
    self,
    ec2_image_id: "capo_workspaces.types.ec2_image_id.Ec2ImageId",
    ingestion_process: "capo_workspaces.types.workspace_image_ingestion_process.WorkspaceImageIngestionProcess",
    image_name: "capo_workspaces.types.workspace_image_name.WorkspaceImageName",
    image_description: "capo_workspaces.types.workspace_image_description.WorkspaceImageDescription",
    *,
    config_overrides: Optional[WorkSpacesClientConfig] = None,
    tags: Optional["capo_workspaces.types.tag_list.TagList"] = None,
    applications: Optional[
        "capo_workspaces.types.application_list.ApplicationList"
    ] = None,
) -> (
    "capo_workspaces.types.import_workspace_image_result.ImportWorkspaceImageResult"
):
    """<p>Imports the specified Windows 10 or 11 Bring Your Own License (BYOL) image into Amazon WorkSpaces. The image must be an already licensed Amazon EC2 image that is in your Amazon Web Services account, and you must own the image. For more information about creating BYOL images, see <a href="https://docs.aws.amazon.com/workspaces/latest/adminguide/byol-windows-images.html"> Bring Your Own Windows Desktop Licenses</a>.</p>

    Args:
        ec2_image_id: <p>The identifier of the EC2 image.</p>
        ingestion_process: <p>The ingestion process to be used when importing the image, depending on which protocol you want to use for your BYOL Workspace image, either PCoIP, WSP, or bring your own protocol (BYOP). To use DCV, specify a value that ends in <code>_WSP</code>. To use PCoIP, specify a value that does not end in <code>_WSP</code>. To use BYOP, specify a value that ends in <code>_BYOP</code>.</p> <p>For non-GPU-enabled bundles (bundles other than Graphics or GraphicsPro), specify <code>BYOL_REGULAR</code>, <code>BYOL_REGULAR_WSP</code>, or <code>BYOL_REGULAR_BYOP</code>, depending on the protocol.</p> <note> <p>The <code>BYOL_REGULAR_BYOP</code> and <code>BYOL_GRAPHICS_G4DN_BYOP</code> values are only supported by Amazon WorkSpaces Core. Contact your account team to be allow-listed to use these values. For more information, see <a href="http://aws.amazon.com/workspaces/core/">Amazon WorkSpaces Core</a>.</p> </note>
        image_name: <p>The name of the WorkSpace image.</p>
        image_description: <p>The description of the WorkSpace image.</p>
        tags: <p>The tags. Each WorkSpaces resource can have a maximum of 50 tags.</p>
        applications: <p>If specified, the version of Microsoft Office to subscribe to. Valid only for Windows 10 and 11 BYOL images. For more information about subscribing to Office for BYOL images, see <a href="https://docs.aws.amazon.com/workspaces/latest/adminguide/byol-windows-images.html"> Bring Your Own Windows Desktop Licenses</a>.</p> <note> <ul> <li> <p>Although this parameter is an array, only one item is allowed at this time.</p> </li> <li> <p>During the image import process, non-GPU DCV (formerly WSP) WorkSpaces with Windows 11 support only <code>Microsoft_Office_2019</code>. GPU DCV (formerly WSP) WorkSpaces with Windows 11 do not support Office installation.</p> </li> </ul> </note>

    Raises:
        capo_workspaces.errors.access_denied_exception.AccessDeniedException: <p>The user is not authorized to access a resource.</p>
        capo_workspaces.errors.invalid_parameter_values_exception.InvalidParameterValuesException: <p>One or more parameter values are not valid.</p>
        capo_workspaces.errors.operation_not_supported_exception.OperationNotSupportedException: <p>This operation is not supported.</p>
        capo_workspaces.errors.resource_already_exists_exception.ResourceAlreadyExistsException: <p>The specified resource already exists.</p>
        capo_workspaces.errors.resource_limit_exceeded_exception.ResourceLimitExceededException: <p>Your resource limits have been exceeded.</p>
        capo_workspaces.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource could not be found.</p>
        capo_workspaces.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_workspaces.types.import_workspace_image_request.ImportWorkspaceImageRequest]",
    ) -> OperationResponse[
        "capo_workspaces.types.import_workspace_image_result.ImportWorkspaceImageResult"
    ]:
        import capo_workspaces._operations.workspaces_service.import_workspace_image

        output, http_response = (
            capo_workspaces._operations.workspaces_service.import_workspace_image.import_workspace_image(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ImportWorkspaceImage")
    )
    input_: capo_workspaces.types.import_workspace_image_request.ImportWorkspaceImageRequest = {
        "ec2_image_id": ec2_image_id,
        "ingestion_process": ingestion_process,
        "image_name": image_name,
        "image_description": image_description,
    }
    if tags is not None:
        input_["tags"] = tags
    if applications is not None:
        input_["applications"] = applications

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output