1import type * as acmpca from "@distilled.cloud/aws/acm-pca";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { CertificateAuthority } from "./CertificateAuthority.ts";
5
6/**
7 * Runtime binding for `acm-pca:GetCertificateAuthorityCsr`.
8 *
9 * Bind a {@link CertificateAuthority} inside a function runtime to retrieve
10 * the CSR the CA generated at creation. The CSR is the input to the CA
11 * activation flow: sign it (self-sign a root via
12 * {@link IssueCertificate}, or have an external parent CA sign it), then
13 * install the result with {@link ImportCertificateAuthorityCertificate}.
14 * Provide `ACMPCA.GetCertificateAuthorityCsrHttp` on the Function effect to
15 * implement the binding.
16 *
17 * ### CA Activation
18 * **Example:** Fetch the CA's CSR
19 * ```typescript
20 * // init
21 * const getCsr = yield* ACMPCA.GetCertificateAuthorityCsr(ca);
22 *
23 * // runtime
24 * const { Csr } = yield* getCsr();
25 * ```
26 *
27 * @binding
28 */
29export interface GetCertificateAuthorityCsr extends Binding.Service<
30 GetCertificateAuthorityCsr,
31 "AWS.ACMPCA.GetCertificateAuthorityCsr",
32 (
33 certificateAuthority: CertificateAuthority,
34 ) => Effect.Effect<
35 () => Effect.Effect<
36 acmpca.GetCertificateAuthorityCsrResponse,
37 acmpca.GetCertificateAuthorityCsrError
38 >
39 >
40> {}
41
42export const GetCertificateAuthorityCsr =
43 Binding.Service<GetCertificateAuthorityCsr>(
44 "AWS.ACMPCA.GetCertificateAuthorityCsr",
45 );