| 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 | import type { Certificate } from "./Certificate.ts"; |
| 5 | |
| 6 | /** |
| 7 | * The revoke request without the injected `CertificateArn`. |
| 8 | */ |
| 9 | export interface RevokeCertificateRequest extends Omit< |
| 10 | acm.RevokeCertificateRequest, |
| 11 | "CertificateArn" |
| 12 | > {} |
| 13 | |
| 14 | /** |
| 15 | * Runtime binding for `acm:RevokeCertificate`. |
| 16 | * |
| 17 | * Bind this operation to a {@link Certificate} to get a callable that revokes |
| 18 | * a previously exported public certificate — e.g. from a security-automation |
| 19 | * function reacting to a leaked private key. Revocation is permanent. Provide |
| 20 | * the implementation with `Effect.provide(AWS.ACM.RevokeCertificateHttp)`. |
| 21 | * ### Revoking Certificates |
| 22 | * **Example:** Revoke a Compromised Certificate |
| 23 | * ```typescript |
| 24 | * // init — bind the operation to the certificate |
| 25 | * const revokeCertificate = yield* AWS.ACM.RevokeCertificate(certificate); |
| 26 | * |
| 27 | * // runtime |
| 28 | * yield* revokeCertificate({ RevocationReason: "KEY_COMPROMISE" }); |
| 29 | * ``` |
| 30 | * |
| 31 | * @binding |
| 32 | */ |
| 33 | export interface RevokeCertificate extends Binding.Service< |
| 34 | RevokeCertificate, |
| 35 | "AWS.ACM.RevokeCertificate", |
| 36 | ( |
| 37 | certificate: Certificate, |
| 38 | ) => Effect.Effect< |
| 39 | ( |
| 40 | request: RevokeCertificateRequest, |
| 41 | ) => Effect.Effect< |
| 42 | acm.RevokeCertificateResponse, |
| 43 | acm.RevokeCertificateError |
| 44 | > |
| 45 | > |
| 46 | > {} |
| 47 | |
| 48 | export const RevokeCertificate = Binding.Service<RevokeCertificate>( |
| 49 | "AWS.ACM.RevokeCertificate", |
| 50 | ); |