createUpdatedWorkspaceImage method

Future<CreateUpdatedWorkspaceImageResult> createUpdatedWorkspaceImage({
  1. required String description,
  2. required String name,
  3. required String sourceImageId,
  4. List<Tag>? tags,
})

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.

May throw AccessDeniedException. May throw InvalidParameterValuesException. May throw InvalidResourceStateException. May throw OperationNotSupportedException. May throw ResourceAlreadyExistsException. May throw ResourceLimitExceededException. May throw ResourceNotFoundException.

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

Parameter name : The name of the new updated WorkSpace image.

Parameter sourceImageId : The identifier of the source WorkSpace image.

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

Implementation

Future<CreateUpdatedWorkspaceImageResult> createUpdatedWorkspaceImage({
  required String description,
  required String name,
  required String sourceImageId,
  List<Tag>? tags,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'WorkspacesService.CreateUpdatedWorkspaceImage'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'Description': description,
      'Name': name,
      'SourceImageId': sourceImageId,
      if (tags != null) 'Tags': tags,
    },
  );

  return CreateUpdatedWorkspaceImageResult.fromJson(jsonResponse.body);
}