| 1 | import type * as serverless from "@distilled.cloud/aws/redshift-serverless"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { Namespace } from "./Namespace.ts"; |
| 5 | |
| 6 | /** |
| 7 | * Runtime binding for the `CreateSnapshot` operation (IAM actions |
| 8 | * `redshift-serverless:CreateSnapshot` + |
| 9 | * `redshift-serverless:TagResource`). |
| 10 | * |
| 11 | * Takes a manual snapshot of the bound {@link Namespace} — e.g. a |
| 12 | * pre-migration backup function or a scheduled snapshot-rotation job. The |
| 13 | * namespace name is injected from the binding. Provide the implementation with |
| 14 | * `Effect.provide(AWS.RedshiftServerless.CreateSnapshotHttp)`. |
| 15 | * ### Managing Snapshots |
| 16 | * **Example:** Take a Manual Snapshot |
| 17 | * ```typescript |
| 18 | * // init — resolve the runtime client |
| 19 | * const createSnapshot = yield* AWS.RedshiftServerless.CreateSnapshot(namespace); |
| 20 | * |
| 21 | * // runtime |
| 22 | * yield* createSnapshot({ |
| 23 | * snapshotName: `pre-migration-${runId}`, |
| 24 | * retentionPeriod: 7, |
| 25 | * }); |
| 26 | * ``` |
| 27 | * |
| 28 | * @binding |
| 29 | */ |
| 30 | export interface CreateSnapshot extends Binding.Service< |
| 31 | CreateSnapshot, |
| 32 | "AWS.RedshiftServerless.CreateSnapshot", |
| 33 | ( |
| 34 | namespace: Namespace, |
| 35 | ) => Effect.Effect< |
| 36 | ( |
| 37 | request: Omit<serverless.CreateSnapshotRequest, "namespaceName">, |
| 38 | ) => Effect.Effect< |
| 39 | serverless.CreateSnapshotResponse, |
| 40 | serverless.CreateSnapshotError |
| 41 | > |
| 42 | > |
| 43 | > {} |
| 44 | export const CreateSnapshot = Binding.Service<CreateSnapshot>( |
| 45 | "AWS.RedshiftServerless.CreateSnapshot", |
| 46 | ); |