Skip to content
the poor coder

EventBridge Event JSON Object

Poor Man
Published
Reading time
1 min read

EventBridge Event JSON Object#

EventBridge is a serverless event bus service provided by AWS that allows you to create and manage events from various sources and consume them using targets such as AWS Lambda, Amazon SNS, Amazon SQS, and more. When an event is generated from a source, it's sent to the event bus where it's processed before reaching the target.

The event object in EventBridge is a JSON object that contains the details of the event. It consists of a header and a body. The header contains the metadata such as the source, time, and type of the event. The body contains the actual data of the event.

Text

{
  "version": "0",
  "id": "12345678-1234-1234-1234-123456789012",
  "detail-type": "myEvent",
  "source": "myEventSource",
  "account": "111122223333",
  "time": "2022-05-22T15:14:34Z",
  "region": "us-east-1",
  "resources": [
    "arn:aws:events:us-east-1:111122223333:rule/myRule"
  ],
  "detail": {
    "key1": "value1",
    "key2": "value2",
    "key3": {
      "key4": "value4"
    }
  }
}
    

Here's a breakdown of each field in the event object:

  • version: The version of the event object. Always set to "0".
  • id: A unique identifier for the event.
  • detail-type: The type of the event, which is used to categorize events.
  • source: The source of the event, which is typically the name of the service or application that generated the event.
  • account: The AWS account ID where the event originated.
  • time: The time when the event was generated, in ISO 8601 format.
  • region: The AWS region where the event originated.
  • resources: An array of ARNs (Amazon Resource Names) that identify the resources that are associated with the event.
  • detail: A JSON object that contains the data of the event. It can be any valid JSON object.

Keep going

2023

how to sort an array

How to Sort an Array If you have an array and you want to order its elements in a specific way, you need to use a sorting algorithm. There are several sorting algorithms available, but two of the most commonly used are…

javascript2 min read
2023

jquery mobile or desktop

jQuery Mobile or Desktop? As a web developer, I have had some experience with both jQuery Mobile and jQuery Desktop. Both frameworks have their pros and cons, and which one to use really depends on the specific project…

javascript1 min read
2023

node.js folder structure

Node.js Folder Structure If you are new to Node.js, it can be daunting to create a folder structure that will work for your project. The structure you choose will depend on the size and complexity of your project. Here…

javascript1 min read
ESC