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