| 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 | export interface CreateCertificateAuthorityAuditReportRequest extends Omit< |
| 7 | acmpca.CreateCertificateAuthorityAuditReportRequest, |
| 8 | "CertificateAuthorityArn" |
| 9 | > {} |
| 10 | |
| 11 | /** |
| 12 | * Runtime binding for `acm-pca:CreateCertificateAuthorityAuditReport`. |
| 13 | * |
| 14 | * Bind a {@link CertificateAuthority} inside a function runtime to generate |
| 15 | * an audit report of every private-key use (issue/revoke) into an S3 |
| 16 | * bucket — e.g. from a scheduled compliance function. AWS allows at most |
| 17 | * one report per CA every 30 minutes. The S3 bucket policy must grant |
| 18 | * Amazon Web Services Private CA write access. Provide |
| 19 | * `ACMPCA.CreateCertificateAuthorityAuditReportHttp` on the Function effect |
| 20 | * to implement the binding. |
| 21 | * |
| 22 | * ### Audit Reports |
| 23 | * **Example:** Generate an Audit Report |
| 24 | * ```typescript |
| 25 | * // init |
| 26 | * const createAuditReport = |
| 27 | * yield* ACMPCA.CreateCertificateAuthorityAuditReport(ca); |
| 28 | * |
| 29 | * // runtime |
| 30 | * const report = yield* createAuditReport({ |
| 31 | * S3BucketName: bucketName, |
| 32 | * AuditReportResponseFormat: "JSON", |
| 33 | * }); |
| 34 | * // report.AuditReportId / report.S3Key |
| 35 | * ``` |
| 36 | * |
| 37 | * @binding |
| 38 | */ |
| 39 | export interface CreateCertificateAuthorityAuditReport extends Binding.Service< |
| 40 | CreateCertificateAuthorityAuditReport, |
| 41 | "AWS.ACMPCA.CreateCertificateAuthorityAuditReport", |
| 42 | ( |
| 43 | certificateAuthority: CertificateAuthority, |
| 44 | ) => Effect.Effect< |
| 45 | ( |
| 46 | request: CreateCertificateAuthorityAuditReportRequest, |
| 47 | ) => Effect.Effect< |
| 48 | acmpca.CreateCertificateAuthorityAuditReportResponse, |
| 49 | acmpca.CreateCertificateAuthorityAuditReportError |
| 50 | > |
| 51 | > |
| 52 | > {} |
| 53 | |
| 54 | export const CreateCertificateAuthorityAuditReport = |
| 55 | Binding.Service<CreateCertificateAuthorityAuditReport>( |
| 56 | "AWS.ACMPCA.CreateCertificateAuthorityAuditReport", |
| 57 | ); |