Changes to FaunaDB Documents to AWS EventBridge Event Bus
@dylburger
code:
data:privatelast updated:3 years ago
today
Build integrations remarkably fast!
You're viewing a public workflow template.
Sign up to customize, add steps, modify code and more.
Join 800,000+ developers using the Pipedream platform
steps.
trigger
active
last updated:-last event:-
steps.
send_event_to_eventbridge_bus
Sends an event to an EventBridge event bus
auth
(auths.aws)
params
AWS Region

Region tied to your EventBridge event bus, e.g. us-east-1 or us-west-2

 
us-west-2
string ·params.region
Event Bus Name

The name of the EventBridge event bus

 
string ·params.EventBusName
Event data

A variable reference to the event data you want to send to the event bus (e.g. event.body)

{{event}}
string ·params.eventData
code
async (params, auths) => {
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
}
25
const AWS = require("aws-sdk")
const { accessKeyId, secretAccessKey } = auths.aws
const { region, EventBusName, eventData } = params

const eventbridge = new AWS.EventBridge({
  accessKeyId, 
  secretAccessKey,
  region,
})

// See https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/EventBridge.html#putEvents-property
const putEventsParams = {
  Entries: [
    {
      Detail: JSON.stringify(eventData),
      DetailType: Object.keys(eventData).join(" "),
      EventBusName,
      Source: 'pipedream',
    },
  ]
}

this.res = await eventbridge.putEvents(putEventsParams).promise()