Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jmnarloch/aws-eventbridge-pattern-builder

AWS EventBridge Pattern DSL
https://github.com/jmnarloch/aws-eventbridge-pattern-builder

Last synced: 4 days ago
JSON representation

AWS EventBridge Pattern DSL

Awesome Lists containing this project

README

        

# AWS EventBridge Rule Pattern DSL

> A Java utility library for creating EventBridge Patterns.

## Setup

Add the library to your project:

```xml

io.jmnarloch
aws-eventbridge-pattern-builder
1.0.0

```

## Usage

Library defines very simple builder pattern for creating an EventBridge Rule patterns.

Examples:

Matching events publish by `aws.ec2`.

```
EventsPattern.builder()
.equal("source", "aws.ec2")
.build();
```

Matching events based on the `detail` content.

```
EventsPattern.builder()
.path("detail")
.equal("state", "terminated")
.parent()
.build();
```

Matching attributes by prefix.

```
EventsPattern.builder()
.prefix("region", "eu-")
.build();
```

Matching events that attribute is any value other then specified.

```
EventsPattern.builder()
.path("detail")
.anythingBut("state", "initializing")
.parent()
.build();
```

Matching the events based on specified number comparision.

```
EventsPattern.builder()
.path("detail")
.numeric("c-count", Comparision.GREATER_THAN, 5)
.numeric("d-count", Comparision.LOWER_THAN, 10)
.numeric("x-limit", Comparision.EQUAL, 3.018e2)
.parent()
.build();
```

See also the [documentation](https://docs.aws.amazon.com/eventbridge/latest/userguide/content-filtering-with-event-patterns.html#filtering-numeric-matching) for supported EventBridge operators.

## License

Apache 2.0