Skip to content

GetCertificate

Source: src/AWS/ACM/GetCertificate.ts

Runtime binding for acm:GetCertificate.

Bind this operation to a Certificate to get a callable that retrieves the issued certificate body and its certificate chain (both PEM-encoded). The certificate must be issued — a certificate that is still pending validation fails with the typed RequestInProgressException. Provide the implementation with Effect.provide(AWS.ACM.GetCertificateHttp).

Fetch the PEM Certificate Chain

// init — bind the operation to the certificate
const getCertificate = yield* AWS.ACM.GetCertificate(certificate);
// runtime
const result = yield* getCertificate();
const pem = result.Certificate;
const chain = result.CertificateChain;

Handle a Certificate That Is Not Issued Yet

const pem = yield* getCertificate().pipe(
Effect.map((result) => result.Certificate),
Effect.catchTag("RequestInProgressException", () =>
Effect.succeed(undefined),
),
);