createMicrosoftAD method

Future<CreateMicrosoftADResult> createMicrosoftAD({
  1. required String name,
  2. required String password,
  3. required DirectoryVpcSettings vpcSettings,
  4. String? description,
  5. DirectoryEdition? edition,
  6. NetworkType? networkType,
  7. String? shortName,
  8. List<Tag>? tags,
})

Creates a Microsoft AD directory in the Amazon Web Services Cloud. For more information, see Managed Microsoft AD in the Directory Service Admin Guide.

Before you call CreateMicrosoftAD, ensure that all of the required permissions have been explicitly granted through a policy. For details about what permissions are required to run the CreateMicrosoftAD operation, see Directory Service API Permissions: Actions, Resources, and Conditions Reference.

May throw ClientException. May throw DirectoryLimitExceededException. May throw InvalidParameterException. May throw ServiceException. May throw UnsupportedOperationException.

Parameter name : The fully qualified domain name for the Managed Microsoft AD directory, such as corp.example.com. This name will resolve inside your VPC only. It does not need to be publicly resolvable.

Parameter password : The password for the default administrative user named Admin.

If you need to change the password for the administrator account, you can use the ResetUserPassword API call.

Parameter vpcSettings : Contains VPC information for the CreateDirectory or CreateMicrosoftAD operation.

Parameter description : A description for the directory. This label will appear on the Amazon Web Services console Directory Details page after the directory is created.

Parameter edition : Managed Microsoft AD is available in two editions: Standard and Enterprise. Enterprise is the default.

Parameter networkType : The network type for your domain. The default value is IPv4 or IPv6 based on the provided subnet capabilities.

Parameter shortName : The NetBIOS name for your domain, such as CORP. If you don't specify a NetBIOS name, it will default to the first part of your directory DNS. For example, CORP for the directory DNS corp.example.com.

Parameter tags : The tags to be assigned to the Managed Microsoft AD directory.

Implementation

Future<CreateMicrosoftADResult> createMicrosoftAD({
  required String name,
  required String password,
  required DirectoryVpcSettings vpcSettings,
  String? description,
  DirectoryEdition? edition,
  NetworkType? networkType,
  String? shortName,
  List<Tag>? tags,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'DirectoryService_20150416.CreateMicrosoftAD'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'Name': name,
      'Password': password,
      'VpcSettings': vpcSettings,
      if (description != null) 'Description': description,
      if (edition != null) 'Edition': edition.value,
      if (networkType != null) 'NetworkType': networkType.value,
      if (shortName != null) 'ShortName': shortName,
      if (tags != null) 'Tags': tags,
    },
  );

  return CreateMicrosoftADResult.fromJson(jsonResponse.body);
}