| 1 | import type * as acm from "@distilled.cloud/aws/acm"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | |
| 5 | export interface ListCertificatesRequest extends acm.ListCertificatesRequest {} |
| 6 | |
| 7 | /** |
| 8 | * Runtime binding for `acm:ListCertificates`. |
| 9 | * |
| 10 | * An account-level operation (no certificate argument) that enumerates the |
| 11 | * ACM certificates in `us-east-1` — the region where alchemy-managed |
| 12 | * certificates live. Useful for expiry monitors that sweep every certificate |
| 13 | * in the account. Note that the default filter only returns `RSA_2048` |
| 14 | * certificates; pass `Includes.keyTypes` to widen it. Provide the |
| 15 | * implementation with `Effect.provide(AWS.ACM.ListCertificatesHttp)`. |
| 16 | * ### Inspecting Certificates |
| 17 | * **Example:** List Certificates Expiring Soon |
| 18 | * ```typescript |
| 19 | * // init — account-level binding takes no resource |
| 20 | * const listCertificates = yield* AWS.ACM.ListCertificates(); |
| 21 | * |
| 22 | * // runtime |
| 23 | * const result = yield* listCertificates({ |
| 24 | * CertificateStatuses: ["ISSUED"], |
| 25 | * }); |
| 26 | * const expiring = (result.CertificateSummaryList ?? []).filter( |
| 27 | * (summary) => |
| 28 | * summary.NotAfter !== undefined && |
| 29 | * summary.NotAfter.getTime() - Date.now() < 30 * 24 * 60 * 60 * 1000, |
| 30 | * ); |
| 31 | * ``` |
| 32 | * |
| 33 | * @binding |
| 34 | */ |
| 35 | export interface ListCertificates extends Binding.Service< |
| 36 | ListCertificates, |
| 37 | "AWS.ACM.ListCertificates", |
| 38 | () => Effect.Effect< |
| 39 | ( |
| 40 | request?: ListCertificatesRequest, |
| 41 | ) => Effect.Effect<acm.ListCertificatesResponse, acm.ListCertificatesError> |
| 42 | > |
| 43 | > {} |
| 44 | |
| 45 | export const ListCertificates = Binding.Service<ListCertificates>( |
| 46 | "AWS.ACM.ListCertificates", |
| 47 | ); |