AWS Python boto3 lambda - getting the kinesis stream name

Viewed 12

I am a lambda in aws python boto3. I configured this lambda (a trigger) to read from a specific kinesis stream. It has to read the stream name from the event object. I don't know how to get the stream name. I don't want to hard code the Kinesis stream name in the code. I want to read it from event.

   import boto3
   import json
   from pprint import pprint

   s3 = boto3.client('s3')
   kinesis = boto3.client('kinesis')

  def lambda_handler(event, context):
       if event:

          for i in event["Records"]:
             print(i)
   
0 Answers
Related