1

I have an existing kinesis instance and my aim is to connect to it via a lambda function and process the records.

I created the lambda using vscode aws-toolkit extension by "create new SAM Application". I put some test records using boto3 in python. every time I revoke the lambda locally in the debug mode, the event is an empty object so there are no records to parse.

I can connect to the kinesis and retrieve records in python using boto3 to confirm the existence of the records.

Here is my template.yaml

Globals:
  Function: 
  Timeout: 60

Resources: 
  KinesisRecors: Type: AWS::Serverless::Function
  Properties: 
    CodeUri: kinesis_records/ 
    Handler: app.lambda_handler 
    Runtime: python3.8 
    Events: 
      KinesisEvent: 
        Type: Kinesis 
        Properties: 
          Stream: arn:aws:.... 
          StartingPosition: TRIM_HORIZON 
          BatchSize: 10 
          Enabled: false

I have also tested with Enabled: true with no success

The lamda function

import base64
def lambda_handler(event, context):
    for record in event['Records']:
       payload=base64.b64decode(record["kinesis"]["data"])

Is it possible to invoke the function locally and get records?

ashil
  • 151
  • 1
  • 7
  • So you want a kinesis event **invoke** your lambda running on your local computer? (I don't believe this to be possible.) – petey Jun 18 '21 at 04:44
  • I want my local lambda function invoke (trigger manually in vscode debugger), read the actual data from the kinesis instance and not providing some test data for the function in the launch.json – ashil Jun 18 '21 at 14:26

0 Answers0