Skip to content

enable_ca_enrollment_policy async

enable_ca_enrollment_policy(
    directory_id: DirectoryId,
    pca_connector_arn: PcaConnectorArn,
    *,
    config_overrides: Optional[AsyncDirectoryServiceClientConfig] = None,
) -> EnableCAEnrollmentPolicyResult

Enables certificate authority (CA) enrollment policy for the specified directory. This allows domain-joined clients to automatically request and receive certificates from the specified Amazon Web Services Private Certificate Authority.

Before enabling CA enrollment, ensure that the PCA connector is properly configured and accessible from the directory. The connector must be in an active state and have the necessary permissions.

Parameters:

  • directory_id (DirectoryId) –

    The identifier of the directory for which to enable the CA enrollment policy.

  • pca_connector_arn (PcaConnectorArn) –

    The Amazon Resource Name (ARN) of the Private Certificate Authority (PCA) connector to use for automatic certificate enrollment. This connector must be properly configured and accessible from the directory.

    The ARN format is: arn:aws:pca-connector-ad:region:account-id:connector/connector-id

Raises:

Source code in docs_src/capo_directory_service/_services/async_directory_service.py
async def enable_ca_enrollment_policy(
    self,
    directory_id: "capo_directory_service.types.directory_id.DirectoryId",
    pca_connector_arn: "capo_directory_service.types.pca_connector_arn.PcaConnectorArn",
    *,
    config_overrides: Optional[AsyncDirectoryServiceClientConfig] = None,
) -> "capo_directory_service.types.enable_ca_enrollment_policy_result.EnableCAEnrollmentPolicyResult":
    """<p>Enables certificate authority (CA) enrollment policy for the specified directory. This allows domain-joined clients to automatically request and receive certificates from the specified Amazon Web Services Private Certificate Authority.</p> <note> <p>Before enabling CA enrollment, ensure that the PCA connector is properly configured and accessible from the directory. The connector must be in an active state and have the necessary permissions.</p> </note>

    Args:
        directory_id: <p>The identifier of the directory for which to enable the CA enrollment policy.</p>
        pca_connector_arn: <p>The Amazon Resource Name (ARN) of the Private Certificate Authority (PCA) connector to use for automatic certificate enrollment. This connector must be properly configured and accessible from the directory.</p> <p>The ARN format is: <code>arn:aws:pca-connector-ad:<i>region</i>:<i>account-id</i>:connector/<i>connector-id</i> </code> </p>

    Raises:
        capo_directory_service.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_directory_service.errors.client_exception.ClientException: <p>A client exception has occurred.</p>
        capo_directory_service.errors.directory_does_not_exist_exception.DirectoryDoesNotExistException: <p>The specified directory does not exist in the system.</p>
        capo_directory_service.errors.directory_unavailable_exception.DirectoryUnavailableException: <p>The specified directory is unavailable.</p>
        capo_directory_service.errors.enable_already_in_progress_exception.EnableAlreadyInProgressException: <p>An enable operation for CA enrollment policy is already in progress for this directory.</p>
        capo_directory_service.errors.entity_already_exists_exception.EntityAlreadyExistsException: <p>The specified entity already exists.</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.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_directory_service.types.enable_ca_enrollment_policy_request.EnableCAEnrollmentPolicyRequest]",
    ) -> AsyncOperationResponse[
        "capo_directory_service.types.enable_ca_enrollment_policy_result.EnableCAEnrollmentPolicyResult"
    ]:
        import capo_directory_service._operations.directory_service_20150416.enable_ca_enrollment_policy

        (
            output,
            http_response,
        ) = await capo_directory_service._operations.directory_service_20150416.enable_ca_enrollment_policy.async_enable_ca_enrollment_policy(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("EnableCAEnrollmentPolicy")
    )
    input_: capo_directory_service.types.enable_ca_enrollment_policy_request.EnableCAEnrollmentPolicyRequest = {
        "directory_id": directory_id,
        "pca_connector_arn": pca_connector_arn,
    }

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output