Skip to content

create_connector async

create_connector(
    directory_id: DirectoryId,
    certificate_authority_arn: CertificateAuthorityArn,
    vpc_information: VpcInformation,
    *,
    config_overrides: Optional[AsyncPcaConnectorAdClientConfig] = None,
    client_token: Optional[ClientToken] = None,
    tags: Optional[Tags] = None,
) -> CreateConnectorResponse

Creates a connector between Amazon Web Services Private CA and an Active Directory. You must specify the private CA, directory ID, and security groups.

Parameters:

  • directory_id (DirectoryId) –

    The identifier of the Active Directory.

  • certificate_authority_arn (CertificateAuthorityArn) –

    The Amazon Resource Name (ARN) of the certificate authority being used.

  • vpc_information (VpcInformation) –

    Information about your VPC and security groups used with the connector.

  • client_token (Optional[ClientToken], default: None ) –

    Idempotency token.

  • tags (Optional[Tags], default: None ) –

    Metadata assigned to a connector consisting of a key-value pair.

Raises:

  • AccessDeniedException –

    You can receive this error if you attempt to create a resource share when you don't have the required permissions. This can be caused by insufficient permissions in policies attached to your Amazon Web Services Identity and Access Management (IAM) principal. It can also happen because of restrictions in place from an Amazon Web Services Organizations service control policy (SCP) that affects your Amazon Web Services account.

  • ConflictException –

    This request cannot be completed for one of the following reasons because the requested resource was being concurrently modified by another request.

  • InternalServerException –

    The request processing has failed because of an unknown error, exception or failure with an internal server.

  • ResourceNotFoundException –

    The operation tried to access a nonexistent resource. The resource might not be specified correctly, or its status might not be ACTIVE.

  • ServiceQuotaExceededException –

    Request would cause a service quota to be exceeded.

  • ThrottlingException –

    The limit on the number of requests per second was exceeded.

  • ValidationException –

    An input validation error occurred. For example, invalid characters in a template name, or if a pagination token is invalid.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_pca_connector_ad/_services/async_pca_connector_ad.py
async def create_connector(
    self,
    directory_id: "capo_pca_connector_ad.types.directory_id.DirectoryId",
    certificate_authority_arn: "capo_pca_connector_ad.types.certificate_authority_arn.CertificateAuthorityArn",
    vpc_information: "capo_pca_connector_ad.types.vpc_information.VpcInformation",
    *,
    config_overrides: Optional[AsyncPcaConnectorAdClientConfig] = None,
    client_token: Optional[
        "capo_pca_connector_ad.types.client_token.ClientToken"
    ] = None,
    tags: Optional["capo_pca_connector_ad.types.tags.Tags"] = None,
) -> (
    "capo_pca_connector_ad.types.create_connector_response.CreateConnectorResponse"
):
    """<p>Creates a connector between Amazon Web Services Private CA and an Active Directory. You must specify the private CA, directory ID, and security groups.</p>

    Args:
        directory_id: <p>The identifier of the Active Directory.</p>
        certificate_authority_arn: <p> The Amazon Resource Name (ARN) of the certificate authority being used.</p>
        vpc_information: <p>Information about your VPC and security groups used with the connector.</p>
        client_token: <p>Idempotency token.</p>
        tags: <p>Metadata assigned to a connector consisting of a key-value pair.</p>

    Raises:
        capo_pca_connector_ad.errors.access_denied_exception.AccessDeniedException: <p>You can receive this error if you attempt to create a resource share when you don't have the required permissions. This can be caused by insufficient permissions in policies attached to your Amazon Web Services Identity and Access Management (IAM) principal. It can also happen because of restrictions in place from an Amazon Web Services Organizations service control policy (SCP) that affects your Amazon Web Services account. </p>
        capo_pca_connector_ad.errors.conflict_exception.ConflictException: <p>This request cannot be completed for one of the following reasons because the requested resource was being concurrently modified by another request.</p>
        capo_pca_connector_ad.errors.internal_server_exception.InternalServerException: <p>The request processing has failed because of an unknown error, exception or failure with an internal server. </p>
        capo_pca_connector_ad.errors.resource_not_found_exception.ResourceNotFoundException: <p>The operation tried to access a nonexistent resource. The resource might not be specified correctly, or its status might not be ACTIVE.</p>
        capo_pca_connector_ad.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>Request would cause a service quota to be exceeded.</p>
        capo_pca_connector_ad.errors.throttling_exception.ThrottlingException: <p>The limit on the number of requests per second was exceeded. </p>
        capo_pca_connector_ad.errors.validation_exception.ValidationException: <p>An input validation error occurred. For example, invalid characters in a template name, or if a pagination token is invalid. </p>
        capo_pca_connector_ad.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_pca_connector_ad.types.create_connector_request.CreateConnectorRequest]",
    ) -> AsyncOperationResponse[
        "capo_pca_connector_ad.types.create_connector_response.CreateConnectorResponse"
    ]:
        import capo_pca_connector_ad._operations.pca_connector_ad.create_connector

        (
            output,
            http_response,
        ) = await capo_pca_connector_ad._operations.pca_connector_ad.create_connector.async_create_connector(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateConnector")
    )
    input_: capo_pca_connector_ad.types.create_connector_request.CreateConnectorRequest = {
        "directory_id": directory_id,
        "certificate_authority_arn": certificate_authority_arn,
        "vpc_information": vpc_information,
    }
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token
    if tags is not None:
        input_["tags"] = tags

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