1import * as memorydb from "@distilled.cloud/aws/memorydb";
2import * as Layer from "effect/Layer";
3import {
4 makeMemoryDBClusterHttpBinding,
5 SNAPSHOT_ARN_WILDCARD,
6} from "./BindingHttp.ts";
7import { CreateSnapshot } from "./CreateSnapshot.ts";
8
9export const CreateSnapshotHttp = Layer.effect(
10 CreateSnapshot,
11 makeMemoryDBClusterHttpBinding({
12 tag: "AWS.MemoryDB.CreateSnapshot",
13 operation: memorydb.createSnapshot,
14 // TagResource authorizes tag-on-create for the snapshot.
15 actions: ["memorydb:CreateSnapshot", "memorydb:TagResource"],
16 // The action authorizes against both the source cluster and the
17 // to-be-created snapshot (whose name-based ARN is runtime data).
18 extraResources: [SNAPSHOT_ARN_WILDCARD],
19 }),
20);