| 1 | import type * as redshift from "@distilled.cloud/aws/redshift"; |
| 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 action |
| 8 | * `redshift:CreateClusterSnapshot` on the cluster and its |
| 9 | * `snapshot:{cluster}/*` ARNs). |
| 10 | * |
| 11 | * Takes a manual snapshot of the bound {@link Cluster} — e.g. a |
| 12 | * pre-migration backup function or a scheduled snapshot-rotation job. The |
| 13 | * cluster identifier is injected from the binding. Provide the |
| 14 | * implementation with |
| 15 | * `Effect.provide(AWS.Redshift.CreateClusterSnapshotHttp)`. |
| 16 | * ### Managing Snapshots |
| 17 | * **Example:** Take a Manual Snapshot |
| 18 | * ```typescript |
| 19 | * // init — bind the operation to the cluster |
| 20 | * const createClusterSnapshot = |
| 21 | * yield* AWS.Redshift.CreateClusterSnapshot(cluster); |
| 22 | * |
| 23 | * // runtime |
| 24 | * yield* createClusterSnapshot({ |
| 25 | * SnapshotIdentifier: `pre-migration-${runId}`, |
| 26 | * }); |
| 27 | * ``` |
| 28 | * |
| 29 | * @binding |
| 30 | */ |
| 31 | export interface CreateClusterSnapshot extends Binding.Service< |
| 32 | CreateClusterSnapshot, |
| 33 | "AWS.Redshift.CreateClusterSnapshot", |
| 34 | ( |
| 35 | cluster: Cluster, |
| 36 | ) => Effect.Effect< |
| 37 | ( |
| 38 | request: Omit<redshift.CreateClusterSnapshotMessage, "ClusterIdentifier">, |
| 39 | ) => Effect.Effect< |
| 40 | redshift.CreateClusterSnapshotResult, |
| 41 | redshift.CreateClusterSnapshotError |
| 42 | > |
| 43 | > |
| 44 | > {} |
| 45 | export const CreateClusterSnapshot = Binding.Service<CreateClusterSnapshot>( |
| 46 | "AWS.Redshift.CreateClusterSnapshot", |
| 47 | ); |