diff --git a/.github/workflows/aws-lambda-java-events.yml b/.github/workflows/aws-lambda-java-events.yml
index c8dc731b..af76e3dc 100644
--- a/.github/workflows/aws-lambda-java-events.yml
+++ b/.github/workflows/aws-lambda-java-events.yml
@@ -25,13 +25,14 @@ jobs:
with:
java-version: 1.8
- # Install base module
+ # Install required module
+ - name: Install serialization with Maven
+ run: mvn -B install --file aws-lambda-java-serialization/pom.xml
+
- name: Install events with Maven
run: mvn -B install --file aws-lambda-java-events/pom.xml
# Package modules that depend on base module
- - name: Package serialization with Maven
- run: mvn -B package --file aws-lambda-java-serialization/pom.xml
- name: Package events-sdk-transformer with Maven
run: mvn -B package --file aws-lambda-java-events-sdk-transformer/pom.xml
diff --git a/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/EventBridgeEvent.java b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/EventBridgeEvent.java
new file mode 100644
index 00000000..e00bcd24
--- /dev/null
+++ b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/EventBridgeEvent.java
@@ -0,0 +1,57 @@
+/*
+ * Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
+ * the License. A copy of the License is located at
+ *
+ * http://aws.amazon.com/apache2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+ * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
+ * and limitations under the License.
+ */
+package com.amazonaws.services.lambda.runtime.events;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.time.Instant;
+import java.util.List;
+
+/**
+ * Object representation of an Amazon EventBridge event.
+ *
+ * @see Using AWS Lambda with Amazon EventBridge (CloudWatch Events)
+ *
+ * @author msailes
+ */
+@Data
+@Builder(setterPrefix = "with")
+@NoArgsConstructor
+@AllArgsConstructor
+public class EventBridgeEvent {
+
+ private String version;
+
+ private String id;
+
+ @JsonProperty("detail-type")
+ private String detailType;
+
+ private String source;
+
+ private String account;
+
+ @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ssX", timezone = "UTC")
+ private Instant time;
+
+ private String region;
+
+ private List resources;
+
+ private T detail;
+}
\ No newline at end of file
diff --git a/aws-lambda-java-events/src/test/java/com/amazonaws/services/lambda/runtime/events/LambdaEventSerializersTest.java b/aws-lambda-java-events/src/test/java/com/amazonaws/services/lambda/runtime/events/LambdaEventSerializersTest.java
index 5119e8d4..a6138fbc 100644
--- a/aws-lambda-java-events/src/test/java/com/amazonaws/services/lambda/runtime/events/LambdaEventSerializersTest.java
+++ b/aws-lambda-java-events/src/test/java/com/amazonaws/services/lambda/runtime/events/LambdaEventSerializersTest.java
@@ -300,6 +300,14 @@ public void testDynamodbTimeWindowEvent() throws IOException {
assertJsonEqual(expected, actual);
}
+ @Test
+ public void testEventBridgeEvent() throws IOException {
+ String expected = EventUtils.readEvent("eventbridge_event.json");
+ String actual = deserializeSerializeJsonToString(expected, EventBridgeEvent.class);
+
+ assertJsonEqual(expected, actual);
+ }
+
@Test
public void testIamPolicyResponse() throws IOException {
String expected = EventUtils.readEvent("iam_policy_response.json");
@@ -516,7 +524,7 @@ public void testTimeWindowEventResponse() throws IOException {
assertJsonEqual(expected, actual);
}
- private String deserializeSerializeJsonToString(String expected, Class modelClass) throws IOException {
+ private String deserializeSerializeJsonToString(String expected, Class modelClass) {
T event = CUSTOM_POJO_SERIALIZER.fromJson(expected, modelClass);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
diff --git a/aws-lambda-java-events/src/test/resources/event_models/eventbridge_event.json b/aws-lambda-java-events/src/test/resources/event_models/eventbridge_event.json
new file mode 100644
index 00000000..17edb82b
--- /dev/null
+++ b/aws-lambda-java-events/src/test/resources/event_models/eventbridge_event.json
@@ -0,0 +1,22 @@
+{
+ "version": "0",
+ "id": "fe8d3c65-xmpl-c5c3-2c87-81584709a377",
+ "detail-type": "RDS DB Instance Event",
+ "source": "aws.rds",
+ "account": "123456789012",
+ "time": "2020-04-28T07:20:20Z",
+ "region": "us-east-2",
+ "resources": [
+ "arn:aws:rds:us-east-2:123456789012:db:rdz6xmpliljlb1"
+ ],
+ "detail": {
+ "EventCategories": [
+ "backup"
+ ],
+ "SourceType": "DB_INSTANCE",
+ "SourceArn": "arn:aws:rds:us-east-2:123456789012:db:rdz6xmpliljlb1",
+ "Date": "2020-04-28T07:20:20.112Z",
+ "Message": "Finished DB Instance backup",
+ "SourceIdentifier": "rdz6xmpliljlb1"
+ }
+}
\ No newline at end of file