Skip to content

batch_create_certificate_authority_replica async

batch_create_certificate_authority_replica(
    certificate_authority_arn: Arn,
    replicas: BatchCreateCertificateAuthorityReplicaRequestEntryList,
    *,
    config_overrides: Optional[AsyncACMPCAClientConfig] = None,
) -> BatchCreateCertificateAuthorityReplicaResponse

Creates replicas of an ACTIVE multi-Region private certificate authority (CA) in up to 20 Amazon Web Services Regions. Call this operation in the Region of the primary CA. Each 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 request is not valid, for example because the primary CA is not ACTIVE, the operation returns an error and creates no replicas.

Amazon Web Services Private CA processes each Region independently and lists the results under Successful or Failed. For more information about failure reasons, see FailedReplica.

To use this operation, you must have the acm-pca:CreateCertificateAuthorityReplica permission on the primary CA, and the acm-pca:CreateCertificateAuthority permission in each replica Region. If you tag the replicas, you must also have the acm-pca:TagCertificateAuthority permission in each replica Region. Amazon Web Services Private CA checks acm-pca:CreateCertificateAuthorityReplica once for each replica. If any replica is denied, the whole request is denied and Amazon Web Services Private CA creates no replicas.

Amazon Web Services Private CA creates replicas asynchronously. To check the status of each 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

  • replicas (BatchCreateCertificateAuthorityReplicaRequestEntryList) –

    The replicas to create, one entry for each replica Region. You can specify up to 20 entries.

Raises:

Source code in docs_src/capo_acm_pca/_services/async_acmpca.py
async def batch_create_certificate_authority_replica(
    self,
    certificate_authority_arn: "capo_acm_pca.types.arn.Arn",
    replicas: "capo_acm_pca.types.batch_create_certificate_authority_replica_request_entry_list.BatchCreateCertificateAuthorityReplicaRequestEntryList",
    *,
    config_overrides: Optional[AsyncACMPCAClientConfig] = None,
) -> "capo_acm_pca.types.batch_create_certificate_authority_replica_response.BatchCreateCertificateAuthorityReplicaResponse":
    """<p>Creates replicas of an <code>ACTIVE</code> multi-Region private certificate authority (CA) in up to 20 Amazon Web Services Regions. Call this operation in the Region of the primary CA. Each 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.</p> <p>If the request is not valid, for example because the primary CA is not <code>ACTIVE</code>, the operation returns an error and creates no replicas.</p> <p>Amazon Web Services Private CA processes each Region independently and lists the results under <code>Successful</code> or <code>Failed</code>. For more information about failure reasons, see <code>FailedReplica</code>.</p> <p>To use this operation, you must have the <code>acm-pca:CreateCertificateAuthorityReplica</code> permission on the primary CA, and the <code>acm-pca:CreateCertificateAuthority</code> permission in each replica Region. If you tag the replicas, you must also have the <code>acm-pca:TagCertificateAuthority</code> permission in each replica Region. Amazon Web Services Private CA checks <code>acm-pca:CreateCertificateAuthorityReplica</code> once for each replica. If any replica is denied, the whole request is denied and Amazon Web Services Private CA creates no replicas.</p> <p>Amazon Web Services Private CA creates replicas asynchronously. To check the status of each 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>
        replicas: <p>The replicas to create, one entry for each replica Region. You can specify up to 20 entries.</p>

    Raises:
        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.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.batch_create_certificate_authority_replica_request.BatchCreateCertificateAuthorityReplicaRequest]",
    ) -> AsyncOperationResponse[
        "capo_acm_pca.types.batch_create_certificate_authority_replica_response.BatchCreateCertificateAuthorityReplicaResponse"
    ]:
        if req.options.protocol == "awsJson1_1":
            import capo_acm_pca._operations.acm_private_ca.aws_json1_1.batch_create_certificate_authority_replica

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

            (
                output,
                http_response,
            ) = await capo_acm_pca._operations.acm_private_ca.rpcv2_cbor.batch_create_certificate_authority_replica.async_batch_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("BatchCreateCertificateAuthorityReplica")
    )
    input_: capo_acm_pca.types.batch_create_certificate_authority_replica_request.BatchCreateCertificateAuthorityReplicaRequest = {
        "certificate_authority_arn": certificate_authority_arn,
        "replicas": replicas,
    }

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