Skip to content

create_certificate_authority_replica async

create_certificate_authority_replica(
    certificate_authority_arn: Arn,
    replica_region: AwsRegion,
    *,
    config_overrides: Optional[AsyncACMPCAClientConfig] = None,
    tags: Optional[TagList] = None,
    idempotency_token: Optional[ClientToken] = None,
) -> CreateCertificateAuthorityReplicaResponse

Creates a replica of an ACTIVE multi-Region private certificate authority (CA) in the Amazon Web Services Region that you specify. Call this operation in the Region of the primary CA. The replica has the same Amazon Resource Name (ARN) as the primary CA, except for the Region, and counts against the CA quota of its Region. If the Region already has a replica, the operation returns a ConflictException.

Amazon Web Services Private CA creates the replica in its Region with your credentials. To use this operation, you must also have the acm-pca:CreateCertificateAuthority permission in the replica Region, and the acm-pca:TagCertificateAuthority permission there if you tag the replica.

Amazon Web Services Private CA creates replicas asynchronously. To check the status of the replica, use the ListCertificateAuthorityReplicas operation.

Parameters:

  • certificate_authority_arn (Arn) –

    The Amazon Resource Name (ARN) of the primary CA to replicate. This must be of the form:

    arn:aws:acm-pca:region:account:certificate-authority/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111

  • replica_region (AwsRegion) –

    The Amazon Web Services Region in which to create the replica. Specify a Region other than the Region of the primary CA. If the Region is an opt-in Region, you must enable it for your account first.

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

    The key-value pairs to attach to the replica. You can attach up to 50 tags to a private CA. Amazon Web Services Private CA doesn't copy the tags of the primary CA to the replica.

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

    A unique, case-sensitive string that ensures the request completes no more than one time. If this token matches a previous request, Amazon Web Services Private CA returns the same replica instead of creating another one.

    If you don't specify an idempotency token, the Amazon Web Services SDK generates one for you.

Raises:

  • ConflictException –

    The request was rejected because it conflicts with the current state of the specified resource.

  • InvalidArgsException –

    One or more of the specified arguments was not valid.

  • InvalidArnException –

    The requested Amazon Resource Name (ARN) does not refer to an existing resource.

  • InvalidStateException –

    The state of the private CA does not allow this action to occur.

  • InvalidTagException –

    The tag associated with the CA is not valid. The invalid argument is contained in the message field.

  • LimitExceededException –

    An Amazon Web Services Private CA quota has been exceeded. See the exception message returned to determine the quota that was exceeded.

  • RequestInProgressException –

    Your request is already in progress.

  • ResourceNotFoundException –

    A resource such as a private CA, S3 bucket, certificate, audit report, or policy cannot be found.

  • UnknownServiceError –

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

Source code in docs_src/capo_acm_pca/_services/async_acmpca.py
async def create_certificate_authority_replica(
    self,
    certificate_authority_arn: "capo_acm_pca.types.arn.Arn",
    replica_region: "capo_acm_pca.types.aws_region.AwsRegion",
    *,
    config_overrides: Optional[AsyncACMPCAClientConfig] = None,
    tags: Optional["capo_acm_pca.types.tag_list.TagList"] = None,
    idempotency_token: Optional[
        "capo_acm_pca.types.client_token.ClientToken"
    ] = None,
) -> "capo_acm_pca.types.create_certificate_authority_replica_response.CreateCertificateAuthorityReplicaResponse":
    """<p>Creates a replica of an <code>ACTIVE</code> multi-Region private certificate authority (CA) in the Amazon Web Services Region that you specify. Call this operation in the Region of the primary CA. The replica has the same Amazon Resource Name (ARN) as the primary CA, except for the Region, and counts against the CA quota of its Region. If the Region already has a replica, the operation returns a <code>ConflictException</code>.</p> <p>Amazon Web Services Private CA creates the replica in its Region with your credentials. To use this operation, you must also have the <code>acm-pca:CreateCertificateAuthority</code> permission in the replica Region, and the <code>acm-pca:TagCertificateAuthority</code> permission there if you tag the replica.</p> <p>Amazon Web Services Private CA creates replicas asynchronously. To check the status of the replica, use the <code>ListCertificateAuthorityReplicas</code> operation.</p>

    Args:
        certificate_authority_arn: <p>The Amazon Resource Name (ARN) of the primary CA to replicate. This must be of the form:</p> <p> <code>arn:aws:acm-pca:<i>region</i>:<i>account</i>:certificate-authority/<i>a1b2c3d4-5678-90ab-cdef-EXAMPLE11111</i> </code> </p>
        replica_region: <p>The Amazon Web Services Region in which to create the replica. Specify a Region other than the Region of the primary CA. If the Region is an opt-in Region, you must enable it for your account first.</p>
        tags: <p>The key-value pairs to attach to the replica. You can attach up to 50 tags to a private CA. Amazon Web Services Private CA doesn't copy the tags of the primary CA to the replica.</p>
        idempotency_token: <p>A unique, case-sensitive string that ensures the request completes no more than one time. If this token matches a previous request, Amazon Web Services Private CA returns the same replica instead of creating another one.</p> <p>If you don't specify an idempotency token, the Amazon Web Services SDK generates one for you.</p>

    Raises:
        capo_acm_pca.errors.conflict_exception.ConflictException: <p>The request was rejected because it conflicts with the current state of the specified resource.</p>
        capo_acm_pca.errors.invalid_args_exception.InvalidArgsException: <p>One or more of the specified arguments was not valid.</p>
        capo_acm_pca.errors.invalid_arn_exception.InvalidArnException: <p>The requested Amazon Resource Name (ARN) does not refer to an existing resource.</p>
        capo_acm_pca.errors.invalid_state_exception.InvalidStateException: <p>The state of the private CA does not allow this action to occur.</p>
        capo_acm_pca.errors.invalid_tag_exception.InvalidTagException: <p>The tag associated with the CA is not valid. The invalid argument is contained in the message field.</p>
        capo_acm_pca.errors.limit_exceeded_exception.LimitExceededException: <p>An Amazon Web Services Private CA quota has been exceeded. See the exception message returned to determine the quota that was exceeded.</p>
        capo_acm_pca.errors.request_in_progress_exception.RequestInProgressException: <p>Your request is already in progress.</p>
        capo_acm_pca.errors.resource_not_found_exception.ResourceNotFoundException: <p>A resource such as a private CA, S3 bucket, certificate, audit report, or policy cannot be found.</p>
        capo_acm_pca.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_acm_pca.types.create_certificate_authority_replica_request.CreateCertificateAuthorityReplicaRequest]",
    ) -> AsyncOperationResponse[
        "capo_acm_pca.types.create_certificate_authority_replica_response.CreateCertificateAuthorityReplicaResponse"
    ]:
        if req.options.protocol == "awsJson1_1":
            import capo_acm_pca._operations.acm_private_ca.aws_json1_1.create_certificate_authority_replica

            (
                output,
                http_response,
            ) = await capo_acm_pca._operations.acm_private_ca.aws_json1_1.create_certificate_authority_replica.async_create_certificate_authority_replica(
                req.options, req.input
            )
        elif req.options.protocol == "rpcv2Cbor":
            import capo_acm_pca._operations.acm_private_ca.rpcv2_cbor.create_certificate_authority_replica

            (
                output,
                http_response,
            ) = await capo_acm_pca._operations.acm_private_ca.rpcv2_cbor.create_certificate_authority_replica.async_create_certificate_authority_replica(
                req.options, req.input
            )
        else:
            raise ValueError(f"unknown protocol {req.options.protocol!r}")
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateCertificateAuthorityReplica")
    )
    input_: capo_acm_pca.types.create_certificate_authority_replica_request.CreateCertificateAuthorityReplicaRequest = {
        "certificate_authority_arn": certificate_authority_arn,
        "replica_region": replica_region,
    }
    if tags is not None:
        input_["tags"] = tags
    if idempotency_token is None:
        idempotency_token = str(uuid.uuid4())
    input_["idempotency_token"] = idempotency_token

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