Skip to content

import_custom_workspace_image

import_custom_workspace_image(
    image_name: WorkspaceImageName,
    image_description: WorkspaceImageDescription,
    compute_type: ImageComputeType,
    protocol: CustomImageProtocol,
    image_source: ImageSourceIdentifier,
    infrastructure_configuration_arn: InfrastructureConfigurationArn,
    platform: Platform,
    os_version: OSVersion,
    *,
    config_overrides: Optional[WorkSpacesClientConfig] = None,
    tags: Optional[TagList] = None,
) -> ImportCustomWorkspaceImageResult

Imports the specified Windows 10 or 11 Bring Your Own License (BYOL) image into Amazon WorkSpaces using EC2 Image Builder. The image must be an already licensed 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:

  • image_name (WorkspaceImageName) –

    The name of the WorkSpace image.

  • image_description (WorkspaceImageDescription) –

    The description of the WorkSpace image.

  • compute_type (ImageComputeType) –

    The supported compute type for the WorkSpace image.

  • protocol (CustomImageProtocol) –

    The supported protocol for the WorkSpace image. Windows 11 does not support PCOIP protocol.

  • image_source (ImageSourceIdentifier) –

    The options for image import source.

  • infrastructure_configuration_arn (InfrastructureConfigurationArn) –

    The infrastructure configuration ARN that specifies how the WorkSpace image is built.

  • platform (Platform) –

    The platform for the WorkSpace image source.

  • os_version (OSVersion) –

    The OS version for the WorkSpace image source.

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

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

Raises:

Source code in docs_src/capo_workspaces/_services/work_spaces.py
def import_custom_workspace_image(
    self,
    image_name: "capo_workspaces.types.workspace_image_name.WorkspaceImageName",
    image_description: "capo_workspaces.types.workspace_image_description.WorkspaceImageDescription",
    compute_type: "capo_workspaces.types.image_compute_type.ImageComputeType",
    protocol: "capo_workspaces.types.custom_image_protocol.CustomImageProtocol",
    image_source: "capo_workspaces.types.image_source_identifier.ImageSourceIdentifier",
    infrastructure_configuration_arn: "capo_workspaces.types.infrastructure_configuration_arn.InfrastructureConfigurationArn",
    platform: "capo_workspaces.types.platform.Platform",
    os_version: "capo_workspaces.types.os_version.OSVersion",
    *,
    config_overrides: Optional[WorkSpacesClientConfig] = None,
    tags: Optional["capo_workspaces.types.tag_list.TagList"] = None,
) -> "capo_workspaces.types.import_custom_workspace_image_result.ImportCustomWorkspaceImageResult":
    """<p>Imports the specified Windows 10 or 11 Bring Your Own License (BYOL) image into Amazon WorkSpaces using EC2 Image Builder. The image must be an already licensed 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:
        image_name: <p>The name of the WorkSpace image.</p>
        image_description: <p>The description of the WorkSpace image.</p>
        compute_type: <p>The supported compute type for the WorkSpace image.</p>
        protocol: <p>The supported protocol for the WorkSpace image. Windows 11 does not support PCOIP protocol.</p>
        image_source: <p>The options for image import source.</p>
        infrastructure_configuration_arn: <p>The infrastructure configuration ARN that specifies how the WorkSpace image is built.</p>
        platform: <p>The platform for the WorkSpace image source.</p>
        os_version: <p>The OS version for the WorkSpace image source.</p>
        tags: <p>The resource tags. Each WorkSpaces resource can have a maximum of 50 tags.</p>

    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_custom_workspace_image_request.ImportCustomWorkspaceImageRequest]",
    ) -> OperationResponse[
        "capo_workspaces.types.import_custom_workspace_image_result.ImportCustomWorkspaceImageResult"
    ]:
        import capo_workspaces._operations.workspaces_service.import_custom_workspace_image

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ImportCustomWorkspaceImage")
    )
    input_: capo_workspaces.types.import_custom_workspace_image_request.ImportCustomWorkspaceImageRequest = {
        "image_name": image_name,
        "image_description": image_description,
        "compute_type": compute_type,
        "protocol": protocol,
        "image_source": image_source,
        "infrastructure_configuration_arn": infrastructure_configuration_arn,
        "platform": platform,
        "os_version": os_version,
    }
    if tags is not None:
        input_["tags"] = tags

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