| 1 | import type * as docdbelastic from "@distilled.cloud/aws/docdb-elastic"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { Cluster } from "./Cluster.ts"; |
| 5 | |
| 6 | /** |
| 7 | * Runtime binding for the `CreateClusterSnapshot` operation (IAM actions |
| 8 | * `docdb-elastic:CreateClusterSnapshot` + `docdb-elastic:TagResource`), |
| 9 | * scoped to one {@link Cluster}. |
| 10 | * |
| 11 | * Takes an on-demand manual snapshot of the bound elastic cluster — e.g. a |
| 12 | * pre-migration backup from an operational Lambda. Provide the |
| 13 | * implementation with |
| 14 | * `Effect.provide(AWS.DocDBElastic.CreateClusterSnapshotHttp)`. |
| 15 | * ### Managing Snapshots |
| 16 | * **Example:** Take an On-Demand Snapshot |
| 17 | * ```typescript |
| 18 | * const createSnapshot = yield* DocDBElastic.CreateClusterSnapshot(cluster); |
| 19 | * |
| 20 | * const result = yield* createSnapshot({ snapshotName: "pre-migration" }); |
| 21 | * // result.snapshot.status → "CREATING" |
| 22 | * ``` |
| 23 | * |
| 24 | * @binding |
| 25 | */ |
| 26 | export interface CreateClusterSnapshot extends Binding.Service< |
| 27 | CreateClusterSnapshot, |
| 28 | "AWS.DocDBElastic.CreateClusterSnapshot", |
| 29 | ( |
| 30 | cluster: Cluster, |
| 31 | ) => Effect.Effect< |
| 32 | ( |
| 33 | request: Omit<docdbelastic.CreateClusterSnapshotInput, "clusterArn">, |
| 34 | ) => Effect.Effect< |
| 35 | docdbelastic.CreateClusterSnapshotOutput, |
| 36 | docdbelastic.CreateClusterSnapshotError |
| 37 | > |
| 38 | > |
| 39 | > {} |
| 40 | export const CreateClusterSnapshot = Binding.Service<CreateClusterSnapshot>( |
| 41 | "AWS.DocDBElastic.CreateClusterSnapshot", |
| 42 | ); |