1import type * as elasticache from "@distilled.cloud/aws/elasticache";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { ServerlessCache } from "./ServerlessCache.ts";
5
6/**
7 * Runtime binding for the `CreateServerlessCacheSnapshot` operation (IAM
8 * actions `elasticache:CreateServerlessCacheSnapshot` +
9 * `elasticache:AddTagsToResource`), scoped to one {@link ServerlessCache}.
10 *
11 * Takes an on-demand snapshot of the bound serverless cache — e.g. a
12 * pre-migration backup from an operational Lambda. Available for valkey,
13 * redis, and serverless memcached. Provide the implementation with
14 * `Effect.provide(AWS.ElastiCache.CreateServerlessCacheSnapshotHttp)`.
15 * ### Managing Snapshots
16 * **Example:** Take an On-Demand Snapshot
17 * ```typescript
18 * const createSnapshot = yield* ElastiCache.CreateServerlessCacheSnapshot(cache);
19 *
20 * const result = yield* createSnapshot({
21 * ServerlessCacheSnapshotName: "pre-migration",
22 * });
23 * // result.ServerlessCacheSnapshot.Status → "creating"
24 * ```
25 *
26 * @binding
27 */
28export interface CreateServerlessCacheSnapshot extends Binding.Service<
29 CreateServerlessCacheSnapshot,
30 "AWS.ElastiCache.CreateServerlessCacheSnapshot",
31 (
32 cache: ServerlessCache,
33 ) => Effect.Effect<
34 (
35 request: Omit<
36 elasticache.CreateServerlessCacheSnapshotRequest,
37 "ServerlessCacheName"
38 >,
39 ) => Effect.Effect<
40 elasticache.CreateServerlessCacheSnapshotResponse,
41 elasticache.CreateServerlessCacheSnapshotError
42 >
43 >
44> {}
45export const CreateServerlessCacheSnapshot =
46 Binding.Service<CreateServerlessCacheSnapshot>(
47 "AWS.ElastiCache.CreateServerlessCacheSnapshot",
48 );