async def get_certificate_authority_csr(
self,
certificate_authority_arn: "capo_acm_pca.types.arn.Arn",
*,
config_overrides: Optional[AsyncACMPCAClientConfig] = None,
) -> "capo_acm_pca.types.get_certificate_authority_csr_response.GetCertificateAuthorityCsrResponse":
"""<p>Retrieves the certificate signing request (CSR) for your private certificate authority (CA). The CSR is created when you call the <a href="https://docs.aws.amazon.com/privateca/latest/APIReference/API_CreateCertificateAuthority.html">CreateCertificateAuthority</a> action. Sign the CSR with your Amazon Web Services Private CA-hosted or on-premises root or subordinate CA. Then import the signed certificate back into Amazon Web Services Private CA by calling the <a href="https://docs.aws.amazon.com/privateca/latest/APIReference/API_ImportCertificateAuthorityCertificate.html">ImportCertificateAuthorityCertificate</a> action. The CSR is returned as a base64 PEM-encoded string. </p>
Args:
certificate_authority_arn: <p>The Amazon Resource Name (ARN) that was returned when you called the <a href="https://docs.aws.amazon.com/privateca/latest/APIReference/API_CreateCertificateAuthority.html">CreateCertificateAuthority</a> action. This must be of the form: </p> <p> <code>arn:aws:acm-pca:<i>region</i>:<i>account</i>:certificate-authority/<i>12345678-1234-1234-1234-123456789012</i> </code> </p>
Raises:
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.request_failed_exception.RequestFailedException: <p>The request has failed for an unspecified reason.</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.get_certificate_authority_csr_request.GetCertificateAuthorityCsrRequest]",
) -> AsyncOperationResponse[
"capo_acm_pca.types.get_certificate_authority_csr_response.GetCertificateAuthorityCsrResponse"
]:
if req.options.protocol == "awsJson1_1":
import capo_acm_pca._operations.acm_private_ca.aws_json1_1.get_certificate_authority_csr
(
output,
http_response,
) = await capo_acm_pca._operations.acm_private_ca.aws_json1_1.get_certificate_authority_csr.async_get_certificate_authority_csr(
req.options, req.input
)
elif req.options.protocol == "rpcv2Cbor":
import capo_acm_pca._operations.acm_private_ca.rpcv2_cbor.get_certificate_authority_csr
(
output,
http_response,
) = await capo_acm_pca._operations.acm_private_ca.rpcv2_cbor.get_certificate_authority_csr.async_get_certificate_authority_csr(
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("GetCertificateAuthorityCsr")
)
input_: capo_acm_pca.types.get_certificate_authority_csr_request.GetCertificateAuthorityCsrRequest = {
"certificate_authority_arn": certificate_authority_arn
}
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output