createWebApp method

Future<CreateWebAppResponse> createWebApp({
  1. required WebAppIdentityProviderDetails identityProviderDetails,
  2. String? accessEndpoint,
  3. WebAppEndpointDetails? endpointDetails,
  4. List<Tag>? tags,
  5. WebAppEndpointPolicy? webAppEndpointPolicy,
  6. WebAppUnits? webAppUnits,
})

Creates a web app based on specified parameters, and returns the ID for the new web app. You can configure the web app to be publicly accessible or hosted within a VPC.

For more information about using VPC endpoints with Transfer Family, see Create a Transfer Family web app in a VPC.

May throw AccessDeniedException. May throw InternalServiceError. May throw InvalidRequestException. May throw ResourceNotFoundException. May throw ThrottlingException.

Parameter identityProviderDetails : You can provide a structure that contains the details for the identity provider to use with your web app.

For more details about this parameter, see Configure your identity provider for Transfer Family web apps.

Parameter accessEndpoint : The AccessEndpoint is the URL that you provide to your users for them to interact with the Transfer Family web app. You can specify a custom URL or use the default value.

Before you enter a custom URL for this parameter, follow the steps described in Update your access endpoint with a custom URL.

Parameter endpointDetails : The endpoint configuration for the web app. You can specify whether the web app endpoint is publicly accessible or hosted within a VPC.

Parameter tags : Key-value pairs that can be used to group and search for web apps.

Parameter webAppEndpointPolicy : Setting for the type of endpoint policy for the web app. The default value is STANDARD.

If you are creating the web app in an Amazon Web Services GovCloud (US) Region, you can set this parameter to FIPS.

Parameter webAppUnits : A union that contains the value for number of concurrent connections or the user sessions on your web app.

Implementation

Future<CreateWebAppResponse> createWebApp({
  required WebAppIdentityProviderDetails identityProviderDetails,
  String? accessEndpoint,
  WebAppEndpointDetails? endpointDetails,
  List<Tag>? tags,
  WebAppEndpointPolicy? webAppEndpointPolicy,
  WebAppUnits? webAppUnits,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'TransferService.CreateWebApp'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'IdentityProviderDetails': identityProviderDetails,
      if (accessEndpoint != null) 'AccessEndpoint': accessEndpoint,
      if (endpointDetails != null) 'EndpointDetails': endpointDetails,
      if (tags != null) 'Tags': tags,
      if (webAppEndpointPolicy != null)
        'WebAppEndpointPolicy': webAppEndpointPolicy.value,
      if (webAppUnits != null) 'WebAppUnits': webAppUnits,
    },
  );

  return CreateWebAppResponse.fromJson(jsonResponse.body);
}