| 1 | import type * as config from "@distilled.cloud/aws/config-service"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { DeliveryChannel } from "./DeliveryChannel.ts"; |
| 5 | |
| 6 | /** |
| 7 | * Runtime binding for `config:DeliverConfigSnapshot` — trigger an on-demand |
| 8 | * delivery of a configuration snapshot to the bound |
| 9 | * {@link DeliveryChannel}'s S3 bucket; the channel name is injected |
| 10 | * automatically. Requires a running configuration recorder. |
| 11 | * |
| 12 | * Provide `Config.DeliverConfigSnapshotHttp` on the hosting Lambda Function |
| 13 | * to satisfy the requirement. |
| 14 | * ### Delivering Snapshots |
| 15 | * **Example:** Deliver a Snapshot On Demand |
| 16 | * ```typescript |
| 17 | * // init — grants config:DeliverConfigSnapshot |
| 18 | * const deliverSnapshot = yield* AWS.Config.DeliverConfigSnapshot(channel); |
| 19 | * |
| 20 | * // runtime |
| 21 | * const result = yield* deliverSnapshot(); |
| 22 | * console.log(result.configSnapshotId); |
| 23 | * ``` |
| 24 | * |
| 25 | * @binding |
| 26 | */ |
| 27 | export interface DeliverConfigSnapshot extends Binding.Service< |
| 28 | DeliverConfigSnapshot, |
| 29 | "AWS.Config.DeliverConfigSnapshot", |
| 30 | ( |
| 31 | channel: DeliveryChannel, |
| 32 | ) => Effect.Effect< |
| 33 | () => Effect.Effect< |
| 34 | config.DeliverConfigSnapshotResponse, |
| 35 | config.DeliverConfigSnapshotError |
| 36 | > |
| 37 | > |
| 38 | > {} |
| 39 | |
| 40 | export const DeliverConfigSnapshot = Binding.Service<DeliverConfigSnapshot>( |
| 41 | "AWS.Config.DeliverConfigSnapshot", |
| 42 | ); |