Skip to main content

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

Bus (preflight class)

No description

Constructor

new(props: BusProps?): Bus

Properties

No properties

Methods

SignatureDescription
onEvent(name: str, handler: inflight (Event): void, pattern: Json): voidNo description
inflight putEvents(events: Array): void
No description
subscribeQueue(name: str, queue: Queue, pattern: Json): voidNo description

platform.tfaws.Bus (preflight class)

No description

Constructor

new(props: BusProps?): Bus

Properties

No properties

Methods

SignatureDescription
onEvent(name: str, handler: inflight (Event): void, pattern: Json): voidNo description
inflight putEvents(events: Array): void
No description
subscribeQueue(name: str, queue: Queue, pattern: Json): voidNo description

platform.sim.Bus (preflight class)

No description

Constructor

new(props: BusProps?): Bus

Properties

No properties

Methods

SignatureDescription
onEvent(name: str, handler: inflight (Event): void, pattern: Json): voidNo description
inflight putEvents(events: Array): void
No description
subscribeQueue(name: str, queue: Queue, pattern: Json): voidNo description

platform.sim.EventBridgeBus (preflight class)

No description

Constructor

new(props: BusProps?): EventBridgeBus

Properties

No properties

Methods

SignatureDescription
inflight putEvents(events: Array): void
No description
subscribe(callback: inflight (Event): void, pattern: Json): ResourceNo description

platform.awscdk.Bus (preflight class)

No description

Constructor

new(props: BusProps?): Bus

Properties

No properties

Methods

SignatureDescription
static addRulePermission(handler: str, arn: str): voidNo description
onEvent(name: str, handler: inflight (Event): void, pattern: Json): voidNo description
inflight putEvents(events: Array): void
No description
subscribeQueue(name: str, queue: Queue, pattern: Json): voidNo description

platform.aws.Util (preflight class)

No description

Constructor

new(): Util

Properties

No properties

Methods

SignatureDescription
static inflight _putEvent(name: str, event: PutEventCommandInput): voidNo description
static inflight putEvent(name: str, events: Array): void
No description

IBus (interface)

No description

Properties

NameTypeDescription
nodeNodeThe tree node.

Methods

SignatureDescription
onEvent(name: str, handler: inflight (Event): void, pattern: Json): voidNo description
inflight putEvents(events: Array): void
No description
subscribeQueue(name: str, queue: Queue, pattern: Json): voidNo description

BusProps (struct)

No description

Properties

NameTypeDescription
debugbool?No description
namestrNo description

Event (struct)

No description

Properties

NameTypeDescription
accountstrNo description
detailJsonNo description
detailTypestrNo description
idstrNo description
regionstrNo description
resources
Array
No description
sourcestrNo description
timestrNo description
versionstrNo description

PublishEvent (struct)

No description

Properties

NameTypeDescription
detailJsonNo description
detailTypestrNo description
resources
Array
No description
sourcestrNo description
versionstrNo description

platform.aws.PutEventCommandEntry (struct)

No description

Properties

NameTypeDescription
DetailstrNo description
DetailTypestrNo description
EventBusNamestrNo description
Resources
Array
No description
SourcestrNo description

platform.aws.PutEventCommandInput (struct)

No description

Properties

NameTypeDescription
Entries
Array
No description