Skip to content

GetCertificate

Source: src/AWS/ACMPCA/GetCertificate.ts

Runtime binding for acm-pca:GetCertificate.

Bind a CertificateAuthority inside a function runtime to retrieve a certificate previously issued by the CA (via the IssueCertificate binding). Issuance is asynchronous — retry while the typed RequestInProgressException is observed. Provide ACMPCA.GetCertificateHttp on the Function effect to implement the binding.

// init
const getCertificate = yield* ACMPCA.GetCertificate(ca);
// runtime
const certificate = yield* getCertificate({
CertificateArn: issued.CertificateArn!,
}).pipe(
Effect.retry({
while: (e) => e._tag === "RequestInProgressException",
schedule: Schedule.exponential("500 millis"),
times: 8,
}),
);
// certificate.Certificate / certificate.CertificateChain (PEM)