1import * as neptune from "@distilled.cloud/aws/neptune";
2import * as Layer from "effect/Layer";
3import { makeNeptuneClusterHttpBinding } from "./BindingHttp.ts";
4import { CreateDBClusterSnapshot } from "./CreateDBClusterSnapshot.ts";
5
6export const CreateDBClusterSnapshotHttp = Layer.effect(
7 CreateDBClusterSnapshot,
8 makeNeptuneClusterHttpBinding({
9 tag: "AWS.Neptune.CreateDBClusterSnapshot",
10 operation: neptune.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 Neptune
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);