1import type * as rds from "@distilled.cloud/aws/rds";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { DBInstance } from "./DBInstance.ts";
5
6/**
7 * Runtime binding for the `CreateDBSnapshot` operation (IAM actions
8 * `rds:CreateDBSnapshot` +
9 * `rds:AddTagsToResource`).
10 *
11 * Takes a manual snapshot of the bound {@link DBInstance} — e.g. a
12 * pre-migration backup function or a scheduled snapshot-rotation job. The
13 * instance identifier is injected from the binding. Provide the implementation with
14 * `Effect.provide(AWS.RDS.CreateDBSnapshotHttp)`.
15 * ### Managing Instance Snapshots
16 * **Example:** Take a Manual Instance Snapshot
17 * ```typescript
18 * // init — bind the operation to the instance
19 * const createDBSnapshot = yield* AWS.RDS.CreateDBSnapshot(instance);
20 *
21 * // runtime
22 * yield* createDBSnapshot({
23 * DBSnapshotIdentifier: `pre-migration-${runId}`,
24 * });
25 * ```
26 *
27 * @binding
28 */
29export interface CreateDBSnapshot extends Binding.Service<
30 CreateDBSnapshot,
31 "AWS.RDS.CreateDBSnapshot",
32 (
33 instance: DBInstance,
34 ) => Effect.Effect<
35 (
36 request: Omit<rds.CreateDBSnapshotMessage, "DBInstanceIdentifier">,
37 ) => Effect.Effect<rds.CreateDBSnapshotResult, rds.CreateDBSnapshotError>
38 >
39> {}
40export const CreateDBSnapshot = Binding.Service<CreateDBSnapshot>(
41 "AWS.RDS.CreateDBSnapshot",
42);