| 1 | import * as appsync from "@distilled.cloud/aws/appsync"; |
| 2 | import * as Layer from "effect/Layer"; |
| 3 | import { makeAppSyncApiHttpBinding } from "./BindingHttp.ts"; |
| 4 | import { FlushApiCache } from "./FlushApiCache.ts"; |
| 5 | |
| 6 | /** |
| 7 | * HTTP implementation of the {@link FlushApiCache} binding. Calls |
| 8 | * `appsync:FlushApiCache` with the Lambda's IAM role. The action defines |
| 9 | * no IAM resource types, so the grant is necessarily `Resource: "*"`; the |
| 10 | * runtime callable itself is fixed to the bound API's `apiId`. |
| 11 | */ |
| 12 | export const FlushApiCacheHttp = Layer.effect( |
| 13 | FlushApiCache, |
| 14 | makeAppSyncApiHttpBinding({ |
| 15 | tag: "AWS.AppSync.FlushApiCache", |
| 16 | actions: ["appsync:FlushApiCache"], |
| 17 | operation: appsync.flushApiCache, |
| 18 | }), |
| 19 | ); |