createStack method

Future<CreateStackResult> createStack({
  1. required String name,
  2. List<AccessEndpoint>? accessEndpoints,
  3. AgentAccessConfig? agentAccessConfig,
  4. ApplicationSettings? applicationSettings,
  5. ContentRedirection? contentRedirection,
  6. String? description,
  7. String? displayName,
  8. List<String>? embedHostDomains,
  9. String? feedbackURL,
  10. String? redirectURL,
  11. List<StorageConnector>? storageConnectors,
  12. StreamingExperienceSettings? streamingExperienceSettings,
  13. Map<String, String>? tags,
  14. List<UserSetting>? userSettings,
})

Creates a stack to start streaming applications to users. A stack consists of an associated fleet, user access policies, and storage configurations.

May throw ConcurrentModificationException. May throw InvalidAccountStatusException. May throw InvalidParameterCombinationException. May throw InvalidRoleException. May throw LimitExceededException. May throw OperationNotPermittedException. May throw ResourceAlreadyExistsException. May throw ResourceNotFoundException.

Parameter name : The name of the stack.

Parameter accessEndpoints : The list of interface VPC endpoint (interface endpoint) objects. Users of the stack can connect to WorkSpaces Applications only through the specified endpoints.

Parameter agentAccessConfig : The configuration for agent access on the stack. If specified, agent access is enabled for the stack.

Parameter applicationSettings : The persistent application settings for users of a stack. When these settings are enabled, changes that users make to applications and Windows settings are automatically saved after each session and applied to the next session.

Parameter description : The description to display.

Parameter displayName : The stack name to display.

Parameter embedHostDomains : The domains where WorkSpaces Applications streaming sessions can be embedded in an iframe. You must approve the domains that you want to host embedded WorkSpaces Applications streaming sessions.

Parameter feedbackURL : The URL that users are redirected to after they click the Send Feedback link. If no URL is specified, no Send Feedback link is displayed.

Parameter redirectURL : The URL that users are redirected to after their streaming session ends.

Parameter storageConnectors : The storage connectors to enable.

Parameter streamingExperienceSettings : The streaming protocol you want your stack to prefer. This can be UDP or TCP. Currently, UDP is only supported in the Windows native client.

Parameter tags : The tags to associate with the stack. A tag is a key-value pair, and the value is optional. For example, Environment=Test. If you do not specify a value, Environment=.

If you do not specify a value, the value is set to an empty string.

Generally allowed characters are: letters, numbers, and spaces representable in UTF-8, and the following special characters:

_ . : / = + \ - @

For more information about tags, see Tagging Your Resources in the Amazon WorkSpaces Applications Administration Guide.

Parameter userSettings : The actions that are enabled or disabled for users during their streaming sessions. By default, these actions are enabled.

Implementation

Future<CreateStackResult> createStack({
  required String name,
  List<AccessEndpoint>? accessEndpoints,
  AgentAccessConfig? agentAccessConfig,
  ApplicationSettings? applicationSettings,
  ContentRedirection? contentRedirection,
  String? description,
  String? displayName,
  List<String>? embedHostDomains,
  String? feedbackURL,
  String? redirectURL,
  List<StorageConnector>? storageConnectors,
  StreamingExperienceSettings? streamingExperienceSettings,
  Map<String, String>? tags,
  List<UserSetting>? userSettings,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'PhotonAdminProxyService.CreateStack'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'Name': name,
      if (accessEndpoints != null) 'AccessEndpoints': accessEndpoints,
      if (agentAccessConfig != null) 'AgentAccessConfig': agentAccessConfig,
      if (applicationSettings != null)
        'ApplicationSettings': applicationSettings,
      if (contentRedirection != null)
        'ContentRedirection': contentRedirection,
      if (description != null) 'Description': description,
      if (displayName != null) 'DisplayName': displayName,
      if (embedHostDomains != null) 'EmbedHostDomains': embedHostDomains,
      if (feedbackURL != null) 'FeedbackURL': feedbackURL,
      if (redirectURL != null) 'RedirectURL': redirectURL,
      if (storageConnectors != null) 'StorageConnectors': storageConnectors,
      if (streamingExperienceSettings != null)
        'StreamingExperienceSettings': streamingExperienceSettings,
      if (tags != null) 'Tags': tags,
      if (userSettings != null) 'UserSettings': userSettings,
    },
  );

  return CreateStackResult.fromJson(jsonResponse.body);
}