| 1 | import * as serverless from "@distilled.cloud/aws/redshift-serverless"; |
| 2 | import * as Layer from "effect/Layer"; |
| 3 | import { |
| 4 | makeServerlessNamespaceHttpBinding, |
| 5 | serverlessArnPrefix, |
| 6 | } from "./BindingHttp.ts"; |
| 7 | import { CreateSnapshot } from "./CreateSnapshot.ts"; |
| 8 | |
| 9 | export const CreateSnapshotHttp = Layer.effect( |
| 10 | CreateSnapshot, |
| 11 | makeServerlessNamespaceHttpBinding({ |
| 12 | tag: "AWS.RedshiftServerless.CreateSnapshot", |
| 13 | operation: serverless.createSnapshot, |
| 14 | actions: [ |
| 15 | "redshift-serverless:CreateSnapshot", |
| 16 | "redshift-serverless:TagResource", |
| 17 | ], |
| 18 | // The operation authorizes against sibling resource ARNs (snapshots, |
| 19 | // recovery points, the serving workgroup) in addition to the namespace. |
| 20 | extraResources: (arn) => { |
| 21 | const prefix = serverlessArnPrefix(arn); |
| 22 | return [`${prefix}:snapshot/*`]; |
| 23 | }, |
| 24 | }), |
| 25 | ); |