| 1 | import * as DynamoDB from "@distilled.cloud/aws/dynamodb"; |
| 2 | import * as Layer from "effect/Layer"; |
| 3 | import * as Output from "../../Output.ts"; |
| 4 | import { makeTableHttpBinding } from "./BindingHttp.ts"; |
| 5 | import { Scan } from "./Scan.ts"; |
| 6 | |
| 7 | export const ScanHttp = Layer.effect( |
| 8 | Scan, |
| 9 | makeTableHttpBinding({ |
| 10 | tag: "AWS.DynamoDB.Scan", |
| 11 | operation: DynamoDB.scan, |
| 12 | actions: ["dynamodb:Scan"], |
| 13 | resources: (table) => [ |
| 14 | table.tableArn, |
| 15 | Output.interpolate`${table.tableArn}/index/*`, |
| 16 | ], |
| 17 | }), |
| 18 | ); |