0% found this document useful (0 votes)
39 views1 page

Kinesis to DynamoDB Lambda Code

The document contains a Lambda function source code that processes data from Kinesis and stores it in a DynamoDB table named 'telemaxData'. It decodes the base64 encoded data from Kinesis, converts it to JSON, and inserts it into the DynamoDB table. The function returns a success status code upon completion.

Uploaded by

priya141ch
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views1 page

Kinesis to DynamoDB Lambda Code

The document contains a Lambda function source code that processes data from Kinesis and stores it in a DynamoDB table named 'telemaxData'. It decodes the base64 encoded data from Kinesis, converts it to JSON, and inserts it into the DynamoDB table. The function returns a success status code upon completion.

Uploaded by

priya141ch
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Lambda Function Source Code for

Kinesis to DynamoDB
import json
import boto3
import base64

dynamodb = [Link]('dynamodb')
table = [Link]('telemaxData')

def lambda_handler(event, context):


for record in event['Records']:
payload = base64.b64decode(record['kinesis']['data']).decode('utf-8')
data = [Link](payload)
table.put_item(Item=data)
return {'statusCode': 200, 'body': 'Success'}

You might also like