Intro
You can write the data being pushed to your Amazon Kinesis Stream into a Domo DataSet, using an Amazon Lambda function and a Domo JSON Webhook DataSet.
Prerequisites
To write data from a Kinesis Stream to Domo, you will need the following:- a Kinesis Stream receiving data in JSON format, with one JSON object per Kinesis record
- an active Domo instance
Step 1 – Create a JSON Webhook DataSet
Data pushed to Kinesis will be copied into a JSON Webhook dataset. Follow these instructions to create this DataSet:- In the Domo Appstore, find and click on the JSON Webhook connector.
- Click Get the Data.
-
Copy and save the link in the
Webhook URL field. (Note that you cannot change this field.)

- (Optional) If you want a secret credential to be required for the Webhook when data is sent to it, enter it into the Webhook Secret field. (For the remainder of these steps, we will assume a Webhook Secret is not being used.)
- Select whether the DataSet will Append or Replace. It is set to Append by default, which is typically what Kinesis users need.
- Click Next.
- Name your DataSet and click Save.
Step 2 – Create an Amazon Lambda Function
To get data from the Kinesis Stream into the Webhook, you will use an Amazon Lambda function. This is a small JavaScript function which will be called whenever new data is pushed to your Kinesis Stream. The function will consolidate all the new Kinesis records into a single JSON array and send that data to the Webhook. Each record will become a single row in the Domo DataSet. Follow these instructions to create the Lambda Function:-
In the AWS Management Console, choose the Lambda service. (Note that your AWS UI may be slightly different.

-
On the menu on left menu, select
Functions.

-
Click
Create function.

-
Fill out the fields to author the function from scratch:
- Function name – Give your function a descriptive, memorable name.
- Runtime – Select the language your function will use. This tutorial uses Node.js 20.x. Note that it is also possible to create functions using Java, C#, Go, Python, or Ruby.
-
Role – Select
Choose an existing role. Work with your AWS administrator to make sure that there is a role appropriate for this function. The role needs to be able to read from Kinesis, write to CloudWatch (for logging), and make HTTPS calls.

- Click Create function.
-
After the Lambda function has been created, add Kinesis as a trigger to it by selecting
Kinesis from the menu on the left of the screen.

-
Configure the trigger by filling out the required fields. Generally, the default values are acceptable:
- Kinesis stream – Select the Stream that you want to use to trigger this function. This is the stream that is getting the data you want to copy to Domo.
- Consumer – Leave this as No consumer.
- Batch Size – You can adjust this based on how much data your Kinesis Stream has to handle. To start, leave it at 100.
- Starting Position – Set this to Latest. That way, the function will be given the most recent data in the Kinesis Stream.
-
Activate Trigger – Make sure this box is checked.

- Click Add.
-
Click the name of the Function so that the Function Code panel appears.

-
Set the code fields to the following:
- Code entry type – Edit code inline
- Runtime – Node.js 20.x
- Handler – index.handler
-
The code window should show a file called
index.js. Replace all of the code in that file with the following:
-
Below the code window, add two environment variables:
- WEBHOOK_HOST – This should be the domain in the Webhook URL given in the DataSet you created in step 1 of these instructions. It will typically be webhooks.domo.com.
-
WEBHOOK_ENDPOINT
– This should be everything in the Webhook URL starting with “/api”. This will be a very long alphanumeric string of characters.

- From the menu in the editor, select File —> Save.
- At the top of the screen, click Save to save all changes to your Lambda function.