| 1 | import type * as acmpca from "@distilled.cloud/aws/acm-pca"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { CertificateAuthority } from "./CertificateAuthority.ts"; |
| 5 | |
| 6 | /** |
| 7 | * Runtime binding for `acm-pca:GetCertificateAuthorityCertificate`. |
| 8 | * |
| 9 | * Bind a {@link CertificateAuthority} inside a function runtime to retrieve |
| 10 | * the CA's own certificate and chain (PEM) — e.g. to build a trust store |
| 11 | * for mutual-TLS verification of certificates the CA issued. Provide |
| 12 | * `ACMPCA.GetCertificateAuthorityCertificateHttp` on the Function effect to |
| 13 | * implement the binding. |
| 14 | * |
| 15 | * ### Reading the CA Certificate |
| 16 | * **Example:** Build a Trust Store |
| 17 | * ```typescript |
| 18 | * // init |
| 19 | * const getCaCertificate = |
| 20 | * yield* ACMPCA.GetCertificateAuthorityCertificate(ca); |
| 21 | * |
| 22 | * // runtime |
| 23 | * const { Certificate, CertificateChain } = yield* getCaCertificate(); |
| 24 | * ``` |
| 25 | * |
| 26 | * @binding |
| 27 | */ |
| 28 | export interface GetCertificateAuthorityCertificate extends Binding.Service< |
| 29 | GetCertificateAuthorityCertificate, |
| 30 | "AWS.ACMPCA.GetCertificateAuthorityCertificate", |
| 31 | ( |
| 32 | certificateAuthority: CertificateAuthority, |
| 33 | ) => Effect.Effect< |
| 34 | () => Effect.Effect< |
| 35 | acmpca.GetCertificateAuthorityCertificateResponse, |
| 36 | acmpca.GetCertificateAuthorityCertificateError |
| 37 | > |
| 38 | > |
| 39 | > {} |
| 40 | |
| 41 | export const GetCertificateAuthorityCertificate = |
| 42 | Binding.Service<GetCertificateAuthorityCertificate>( |
| 43 | "AWS.ACMPCA.GetCertificateAuthorityCertificate", |
| 44 | ); |