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