Amazon EventBridge
A Wing library for working with Amazon EventBridge.
Prerequisites
Installation
npm i @winglibs/eventbridge
Usage
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",
},
});
});
Parameters
- eventBridgeName -
str
- Optional. Name of an existing EventBridge to reference.
Usage
wing compile -t @winglang/platform-awscdk -v eventBridgeName="my-bus" main.w
License
This library is licensed under the MIT License.
API Reference
Table of Contents
- Classes
- Interfaces
- Structs
Bus (preflight class)
No description
Constructor
new(props: BusProps?): Bus
Properties
No properties
Methods
Signature | Description |
---|---|
onEvent(name: str, handler: inflight (Event): void, pattern: Json): void | No description |
| No description |
subscribeQueue(name: str, queue: Queue, pattern: Json): void | No description |
platform.tfaws.Bus (preflight class)
No description
Constructor
new(props: BusProps?): Bus
Properties
No properties
Methods
Signature | Description |
---|---|
onEvent(name: str, handler: inflight (Event): void, pattern: Json): void | No description |
| No description |
subscribeQueue(name: str, queue: Queue, pattern: Json): void | No description |
platform.sim.Bus (preflight class)
No description
Constructor
new(props: BusProps?): Bus
Properties
No properties
Methods
Signature | Description |
---|---|
onEvent(name: str, handler: inflight (Event): void, pattern: Json): void | No description |
| No description |
subscribeQueue(name: str, queue: Queue, pattern: Json): void | No description |
platform.sim.EventBridgeBus (preflight class)
No description
Constructor
new(props: BusProps?): EventBridgeBus
Properties
No properties
Methods
Signature | Description |
---|---|
| No description |
subscribe(callback: inflight (Event): void, pattern: Json): Resource | No description |
platform.awscdk.Bus (preflight class)
No description
Constructor
new(props: BusProps?): Bus
Properties
No properties
Methods
Signature | Description |
---|---|
static addRulePermission(handler: str, arn: str): void | No description |
onEvent(name: str, handler: inflight (Event): void, pattern: Json): void | No description |
| No description |
subscribeQueue(name: str, queue: Queue, pattern: Json): void | No description |
platform.aws.Util (preflight class)
No description
Constructor
new(): Util
Properties
No properties
Methods
Signature | Description |
---|---|
static inflight _putEvent(name: str, event: PutEventCommandInput): void | No description |
| No description |
IBus (interface)
No description
Properties
Name | Type | Description |
---|---|---|
node | Node | The tree node. |
Methods
Signature | Description |
---|---|
onEvent(name: str, handler: inflight (Event): void, pattern: Json): void | No description |
| No description |
subscribeQueue(name: str, queue: Queue, pattern: Json): void | No description |
BusProps (struct)
No description
Properties
Name | Type | Description |
---|---|---|
debug | bool? | No description |
name | str | No description |
Event (struct)
No description
Properties
Name | Type | Description |
---|---|---|
account | str | No description |
detail | Json | No description |
detailType | str | No description |
id | str | No description |
region | str | No description |
resources |
| No description |
source | str | No description |
time | str | No description |
version | str | No description |
PublishEvent (struct)
No description
Properties
Name | Type | Description |
---|---|---|
detail | Json | No description |
detailType | str | No description |
resources |
| No description |
source | str | No description |
version | str | No description |
platform.aws.PutEventCommandEntry (struct)
No description
Properties
Name | Type | Description |
---|---|---|
Detail | str | No description |
DetailType | str | No description |
EventBusName | str | No description |
Resources |
| No description |
Source | str | No description |
platform.aws.PutEventCommandInput (struct)
No description
Properties
Name | Type | Description |
---|---|---|
Entries |
| No description |