importWorkspaceImage method

Future<ImportWorkspaceImageResult> importWorkspaceImage({
  1. required String ec2ImageId,
  2. required String imageDescription,
  3. required String imageName,
  4. required WorkspaceImageIngestionProcess ingestionProcess,
  5. List<Application>? applications,
  6. List<Tag>? tags,
})

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.

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

Parameter ec2ImageId : The identifier of the EC2 image.

Parameter imageDescription : The description of the WorkSpace image.

Parameter imageName : The name of the WorkSpace image.

Parameter ingestionProcess : 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.

Parameter applications : 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.

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

Implementation

Future<ImportWorkspaceImageResult> importWorkspaceImage({
  required String ec2ImageId,
  required String imageDescription,
  required String imageName,
  required WorkspaceImageIngestionProcess ingestionProcess,
  List<Application>? applications,
  List<Tag>? tags,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'WorkspacesService.ImportWorkspaceImage'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'Ec2ImageId': ec2ImageId,
      'ImageDescription': imageDescription,
      'ImageName': imageName,
      'IngestionProcess': ingestionProcess.value,
      if (applications != null)
        'Applications': applications.map((e) => e.value).toList(),
      if (tags != null) 'Tags': tags,
    },
  );

  return ImportWorkspaceImageResult.fromJson(jsonResponse.body);
}