Skip to content

create_updated_workspace_image

create_updated_workspace_image(
    name: WorkspaceImageName,
    description: WorkspaceImageDescription,
    source_image_id: WorkspaceImageId,
    *,
    config_overrides: Optional[WorkSpacesClientConfig] = None,
    tags: Optional[TagList] = None,
) -> CreateUpdatedWorkspaceImageResult

Creates a new updated WorkSpace image based on the specified source image. The new updated WorkSpace image has the latest drivers and other updates required by the Amazon WorkSpaces components.

To determine which WorkSpace images need to be updated with the latest Amazon WorkSpaces requirements, use DescribeWorkspaceImages.

  • Only Windows 10, Windows Server 2016, and Windows Server 2019 WorkSpace images can be programmatically updated at this time.

  • Microsoft Windows updates and other application updates are not included in the update process.

  • The source WorkSpace image is not deleted. You can delete the source image after you've verified your new updated image and created a new bundle.

Parameters:

  • name (WorkspaceImageName) –

    The name of the new updated WorkSpace image.

  • description (WorkspaceImageDescription) –

    A description of whether updates for the WorkSpace image are available.

  • source_image_id (WorkspaceImageId) –

    The identifier of the source WorkSpace image.

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

    The tags that you want to add to the new updated WorkSpace image.

    To add tags at the same time when you're creating the updated image, you must create an IAM policy that grants your IAM user permissions to use workspaces:CreateTags.

Raises:

Source code in docs_src/capo_workspaces/_services/work_spaces.py
def create_updated_workspace_image(
    self,
    name: "capo_workspaces.types.workspace_image_name.WorkspaceImageName",
    description: "capo_workspaces.types.workspace_image_description.WorkspaceImageDescription",
    source_image_id: "capo_workspaces.types.workspace_image_id.WorkspaceImageId",
    *,
    config_overrides: Optional[WorkSpacesClientConfig] = None,
    tags: Optional["capo_workspaces.types.tag_list.TagList"] = None,
) -> "capo_workspaces.types.create_updated_workspace_image_result.CreateUpdatedWorkspaceImageResult":
    """<p>Creates a new updated WorkSpace image based on the specified source image. The new updated WorkSpace image has the latest drivers and other updates required by the Amazon WorkSpaces components.</p> <p>To determine which WorkSpace images need to be updated with the latest Amazon WorkSpaces requirements, use <a href="https://docs.aws.amazon.com/workspaces/latest/api/API_DescribeWorkspaceImages.html"> DescribeWorkspaceImages</a>.</p> <note> <ul> <li> <p>Only Windows 10, Windows Server 2016, and Windows Server 2019 WorkSpace images can be programmatically updated at this time.</p> </li> <li> <p>Microsoft Windows updates and other application updates are not included in the update process.</p> </li> <li> <p>The source WorkSpace image is not deleted. You can delete the source image after you've verified your new updated image and created a new bundle. </p> </li> </ul> </note>

    Args:
        name: <p>The name of the new updated WorkSpace image.</p>
        description: <p>A description of whether updates for the WorkSpace image are available.</p>
        source_image_id: <p>The identifier of the source WorkSpace image.</p>
        tags: <p>The tags that you want to add to the new updated WorkSpace image.</p> <note> <p>To add tags at the same time when you're creating the updated image, you must create an IAM policy that grants your IAM user permissions to use <code>workspaces:CreateTags</code>. </p> </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.invalid_resource_state_exception.InvalidResourceStateException: <p>The state of the resource is not valid for this operation.</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.create_updated_workspace_image_request.CreateUpdatedWorkspaceImageRequest]",
    ) -> OperationResponse[
        "capo_workspaces.types.create_updated_workspace_image_result.CreateUpdatedWorkspaceImageResult"
    ]:
        import capo_workspaces._operations.workspaces_service.create_updated_workspace_image

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateUpdatedWorkspaceImage")
    )
    input_: capo_workspaces.types.create_updated_workspace_image_request.CreateUpdatedWorkspaceImageRequest = {
        "name": name,
        "description": description,
        "source_image_id": source_image_id,
    }
    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