| 1 | import * as cur from "@distilled.cloud/aws/cost-and-usage-report-service"; |
| 2 | import * as Layer from "effect/Layer"; |
| 3 | import { makeCurHttpBinding } from "./BindingHttp.ts"; |
| 4 | import { DescribeReportDefinitions } from "./DescribeReportDefinitions.ts"; |
| 5 | |
| 6 | /** |
| 7 | * HTTP implementation of {@link DescribeReportDefinitions}: grants |
| 8 | * `cur:DescribeReportDefinitions` on `*` (the API enumerates every report |
| 9 | * definition in the account) and calls the us-east-1 CUR endpoint with the |
| 10 | * function's IAM credentials. |
| 11 | */ |
| 12 | export const DescribeReportDefinitionsHttp = Layer.effect( |
| 13 | DescribeReportDefinitions, |
| 14 | makeCurHttpBinding({ |
| 15 | capability: "DescribeReportDefinitions", |
| 16 | iamActions: ["cur:DescribeReportDefinitions"], |
| 17 | operation: cur.describeReportDefinitions, |
| 18 | }), |
| 19 | ); |