@devries-cameron20 / t3code Mirror · read-only
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 04:45 UTC

main
ts 19 lines 877 Bytes
Raw
1 import * as docdb from "@distilled.cloud/aws/docdb";
2 import * as Layer from "effect/Layer";
3 import { makeDocDBClusterHttpBinding } from "./BindingHttp.ts";
4 import { CreateDBClusterSnapshot } from "./CreateDBClusterSnapshot.ts";
5
6 export const CreateDBClusterSnapshotHttp = Layer.effect(
7 CreateDBClusterSnapshot,
8 makeDocDBClusterHttpBinding({
9 tag: "AWS.DocDB.CreateDBClusterSnapshot",
10 operation: docdb.createDBClusterSnapshot,
11 actions: ["rds:CreateDBClusterSnapshot", "rds:AddTagsToResource"],
12 // Snapshot creation authorizes against BOTH the source cluster ARN and
13 // the target snapshot ARN — widen the grant to the account's DocumentDB
14 // cluster-snapshot space (`arn:…:rds:{region}:{account}:cluster-snapshot:*`).
15 extraResources: (clusterArn) => [
16 `${clusterArn.split(":").slice(0, 5).join(":")}:cluster-snapshot:*`,
17 ],
18 }),
19 );