aws-eventbridge-pattern-builder

AWS EventBridge Pattern Builder

License

License

Categories

Categories

AWS Container PaaS Providers
GroupId

GroupId

io.jmnarloch
ArtifactId

ArtifactId

aws-eventbridge-pattern-builder
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

aws-eventbridge-pattern-builder
AWS EventBridge Pattern Builder
Project URL

Project URL

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

Source Code Management

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

Download aws-eventbridge-pattern-builder

How to add to project

<!-- https://jarcasting.com/artifacts/io.jmnarloch/aws-eventbridge-pattern-builder/ -->
<dependency>
    <groupId>io.jmnarloch</groupId>
    <artifactId>aws-eventbridge-pattern-builder</artifactId>
    <version>1.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/io.jmnarloch/aws-eventbridge-pattern-builder/
implementation 'io.jmnarloch:aws-eventbridge-pattern-builder:1.0.0'
// https://jarcasting.com/artifacts/io.jmnarloch/aws-eventbridge-pattern-builder/
implementation ("io.jmnarloch:aws-eventbridge-pattern-builder:1.0.0")
'io.jmnarloch:aws-eventbridge-pattern-builder:jar:1.0.0'
<dependency org="io.jmnarloch" name="aws-eventbridge-pattern-builder" rev="1.0.0">
  <artifact name="aws-eventbridge-pattern-builder" type="jar" />
</dependency>
@Grapes(
@Grab(group='io.jmnarloch', module='aws-eventbridge-pattern-builder', version='1.0.0')
)
libraryDependencies += "io.jmnarloch" % "aws-eventbridge-pattern-builder" % "1.0.0"
[io.jmnarloch/aws-eventbridge-pattern-builder "1.0.0"]

Dependencies

runtime (1)

Group / Artifact Type Version
com.fasterxml.jackson.core : jackson-databind jar 2.10.2

test (1)

Group / Artifact Type Version
org.junit.jupiter : junit-jupiter-api jar 5.5.1

Project Modules

There are no modules declared in this project.

AWS EventBridge Rule Pattern DSL

A Java utility library for creating EventBridge Patterns.

Setup

Add the library to your project:

 <dependency>
   <groupId>io.jmnarloch</groupId>
   <artifactId>aws-eventbridge-pattern-builder</artifactId>
   <version>1.0.0</version>
 </dependency>

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 for supported EventBridge operators.

License

Apache 2.0

Versions

Version
1.0.0