createHybridAD method

Future<CreateHybridADResult> createHybridAD({
  1. required String assessmentId,
  2. required String secretArn,
  3. List<Tag>? tags,
})

Creates a hybrid directory that connects your self-managed Active Directory (AD) infrastructure and Amazon Web Services.

You must have a successful directory assessment using StartADAssessment to validate your environment compatibility before you use this operation.

Updates are applied asynchronously. Use DescribeDirectories to monitor the progress of directory creation.

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

Parameter assessmentId : The unique identifier of the successful directory assessment that validates your self-managed AD environment. You must have a successful directory assessment before you create a hybrid directory.

Parameter secretArn : The Amazon Resource Name (ARN) of the Amazon Web Services Secrets Manager secret that contains the credentials for the service account used to join hybrid domain controllers to your self-managed AD domain. This secret is used once and not stored.

The secret must contain key-value pairs with keys matching customerAdAdminDomainUsername and customerAdAdminDomainPassword. For example: {"customerAdAdminDomainUsername":"carlos_salazar","customerAdAdminDomainPassword":"ExamplePassword123!"}.

Parameter tags : The tags to be assigned to the directory. Each tag consists of a key and value pair. You can specify multiple tags as a list.

Implementation

Future<CreateHybridADResult> createHybridAD({
  required String assessmentId,
  required String secretArn,
  List<Tag>? tags,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'DirectoryService_20150416.CreateHybridAD'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'AssessmentId': assessmentId,
      'SecretArn': secretArn,
      if (tags != null) 'Tags': tags,
    },
  );

  return CreateHybridADResult.fromJson(jsonResponse.body);
}