A Wing library for working with Amazon EventBridge.
npm i @winglibs/eventbridge
bring cloud;
bring eventbridge;
let bus = new eventbridge.Bus(name: "my-bus");
bus.onEvent("github.pull-request.created", inflight (event) => {
log("subscribed event received {Json.stringify(event)}");
}, {
"detail-type": [{"prefix": "pull-request."}],
"source": ["github.com"],
});
new cloud.Function(inflight () => {
bus.putEvents({
detailType: "pull-request.created",
resources: ["test"],
source: "github.com",
version: "0",
detail: {
"test": "test",
},
});
});
- eventBridgeName -
str
- Optional. Name of an existing EventBridge to reference.
wing compile -t @winglang/platform-awscdk -v eventBridgeName="my-bus" main.w
This library is licensed under the MIT License.