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.
Parameters:
-
secret_arn
(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!"}.
-
assessment_id
(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.
-
tags
(Optional[Tags], default:
None
)
–
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.
Raises:
-
ADAssessmentLimitExceededException
–
A directory assessment is automatically created when you create a hybrid directory. There are two types of assessments: CUSTOMER and SYSTEM. Your Amazon Web Services account has a limit of 100 CUSTOMER directory assessments.
If you attempt to create a hybrid directory; and you already have 100 CUSTOMER directory assessments;, you will encounter an error. Delete assessments to free up capacity before trying again.
You can request an increase to your CUSTOMER directory assessment quota by contacting customer support or delete existing CUSTOMER directory assessments; to free up capacity.
-
ClientException
–
A client exception has occurred.
-
DirectoryLimitExceededException
–
The maximum number of directories in the region has been reached. You can use the GetDirectoryLimits operation to determine your directory limits in the region.
-
EntityDoesNotExistException
–
The specified entity could not be found.
-
InvalidParameterException
–
One or more parameters are not valid.
-
ServiceException
–
An exception has occurred in Directory Service.
-
UnsupportedOperationException
–
The operation is not supported.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Source code in docs_src/capo_directory_service/_services/directory_service.py
| def create_hybrid_ad(
self,
secret_arn: "capo_directory_service.types.secret_arn.SecretArn",
assessment_id: "capo_directory_service.types.assessment_id.AssessmentId",
*,
config_overrides: Optional[DirectoryServiceClientConfig] = None,
tags: Optional["capo_directory_service.types.tags.Tags"] = None,
) -> "capo_directory_service.types.create_hybrid_ad_result.CreateHybridADResult":
"""<p>Creates a hybrid directory that connects your self-managed Active Directory (AD) infrastructure and Amazon Web Services.</p> <p>You must have a successful directory assessment using <a>StartADAssessment</a> to validate your environment compatibility before you use this operation.</p> <p>Updates are applied asynchronously. Use <a>DescribeDirectories</a> to monitor the progress of directory creation.</p>
Args:
secret_arn: <p>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.</p> <p>The secret must contain key-value pairs with keys matching <code>customerAdAdminDomainUsername</code> and <code>customerAdAdminDomainPassword</code>. For example: <code>{"customerAdAdminDomainUsername":"carlos_salazar","customerAdAdminDomainPassword":"ExamplePassword123!"}</code>.</p>
assessment_id: <p>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.</p>
tags: <p>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.</p>
Raises:
capo_directory_service.errors.ad_assessment_limit_exceeded_exception.ADAssessmentLimitExceededException: <p>A directory assessment is automatically created when you create a hybrid directory. There are two types of assessments: <code>CUSTOMER</code> and <code>SYSTEM</code>. Your Amazon Web Services account has a limit of 100 <code>CUSTOMER</code> directory assessments.</p> <p>If you attempt to create a hybrid directory; and you already have 100 <code>CUSTOMER</code> directory assessments;, you will encounter an error. Delete assessments to free up capacity before trying again.</p> <p>You can request an increase to your <code>CUSTOMER</code> directory assessment quota by contacting customer support or delete existing CUSTOMER directory assessments; to free up capacity.</p>
capo_directory_service.errors.client_exception.ClientException: <p>A client exception has occurred.</p>
capo_directory_service.errors.directory_limit_exceeded_exception.DirectoryLimitExceededException: <p>The maximum number of directories in the region has been reached. You can use the <a>GetDirectoryLimits</a> operation to determine your directory limits in the region.</p>
capo_directory_service.errors.entity_does_not_exist_exception.EntityDoesNotExistException: <p>The specified entity could not be found.</p>
capo_directory_service.errors.invalid_parameter_exception.InvalidParameterException: <p>One or more parameters are not valid.</p>
capo_directory_service.errors.service_exception.ServiceException: <p>An exception has occurred in Directory Service.</p>
capo_directory_service.errors.unsupported_operation_exception.UnsupportedOperationException: <p>The operation is not supported.</p>
capo_directory_service.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_directory_service.types.create_hybrid_ad_request.CreateHybridADRequest]",
) -> OperationResponse[
"capo_directory_service.types.create_hybrid_ad_result.CreateHybridADResult"
]:
import capo_directory_service._operations.directory_service_20150416.create_hybrid_ad
output, http_response = (
capo_directory_service._operations.directory_service_20150416.create_hybrid_ad.create_hybrid_ad(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("CreateHybridAD")
)
input_: capo_directory_service.types.create_hybrid_ad_request.CreateHybridADRequest = {
"secret_arn": secret_arn,
"assessment_id": assessment_id,
}
if tags is not None:
input_["tags"] = tags
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|