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