Skip to content

Open-source Grok Bot alternative for named AI teammates. Local-first desktop, web, and mobile clients with per-bot tools, instructions, and memory. Independent fork of T3 Code.

750 B
Raw Blame
import * as memorydb from "@distilled.cloud/aws/memorydb";
import * as Layer from "effect/Layer";
import {
  makeMemoryDBClusterHttpBinding,
  SNAPSHOT_ARN_WILDCARD,
} from "./BindingHttp.ts";
import { CreateSnapshot } from "./CreateSnapshot.ts";

export const CreateSnapshotHttp = Layer.effect(
  CreateSnapshot,
  makeMemoryDBClusterHttpBinding({
    tag: "AWS.MemoryDB.CreateSnapshot",
    operation: memorydb.createSnapshot,
    // TagResource authorizes tag-on-create for the snapshot.
    actions: ["memorydb:CreateSnapshot", "memorydb:TagResource"],
    // The action authorizes against both the source cluster and the
    // to-be-created snapshot (whose name-based ARN is runtime data).
    extraResources: [SNAPSHOT_ARN_WILDCARD],
  }),
);