Changes to FaunaDB Documents to AWS Lambda
@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.
invoke_lambda
Invoke a Lambda function using the AWS API
auth
(auths.aws)
params
AWS Region

The AWS region tied to your Lambda, e.g us-east-1 or us-west-2

 
us-west-2
string ·params.region
Lambda Function Name

The name of your Lambda function. Also accepts a function ARN

 
test-function
string ·params.FunctionName
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, FunctionName, eventData } = params

const lambda = new AWS.Lambda({
  accessKeyId,
  secretAccessKey,
  region
})

// This invokes the Lambda synchronously so you can view the response
// details associated with each invocation. This can be changed. See
// https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Lambda.html#invoke-property
// This also assumes the eventData passed to the step is JSON.
// Please modify the code accordingly if your data is in a different format.
const lambdaParams = {
  Payload: JSON.stringify(eventData),
  FunctionName,
  InvocationType: "RequestResponse",
  LogType: "Tail",
}

this.res = await lambda.invoke(lambdaParams).promise()