| 1 | import * as eventbridge from "@distilled.cloud/aws/eventbridge"; |
| 2 | import * as Layer from "effect/Layer"; |
| 3 | import { makeEventBridgeAccountHttpBinding } from "./BindingHttp.ts"; |
| 4 | import { TestEventPattern } from "./TestEventPattern.ts"; |
| 5 | |
| 6 | /** |
| 7 | * HTTP implementation of {@link TestEventPattern}. At deploy time it grants |
| 8 | * `events:TestEventPattern`; at runtime it calls the EventBridge API with the |
| 9 | * host Function's credentials. Provide this layer on the Function using the |
| 10 | * binding. |
| 11 | */ |
| 12 | export const TestEventPatternHttp = Layer.effect( |
| 13 | TestEventPattern, |
| 14 | makeEventBridgeAccountHttpBinding({ |
| 15 | tag: "AWS.EventBridge.TestEventPattern", |
| 16 | operation: eventbridge.testEventPattern, |
| 17 | actions: ["events:TestEventPattern"], |
| 18 | }), |
| 19 | ); |