Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when handling stream events with Lambda #4

Closed
ebaizel opened this issue Nov 19, 2020 · 2 comments
Closed

Error when handling stream events with Lambda #4

ebaizel opened this issue Nov 19, 2020 · 2 comments

Comments

@ebaizel
Copy link

ebaizel commented Nov 19, 2020

When this Lambda is triggered from a Kinesis stream, it results in the error:

[ERROR] KeyError: 'Records'

This is because the Records key should be records. All keys seem to be lowercase. Here is the event object that is being passed into Lambda (clipped):

{'invocationId': '30a92d49-cb1f-496c-b580-d46b3dd38f43', 'sourceKinesisStreamArn': 'arn:aws:kinesis:us-east-1:643292708081:stream/ion-lab-qldb-stream', 'deliveryStreamArn': 'arn:aws:firehose:us-east-1:643292708081:deliverystream/ion-lab-qldb-stream-json', 'region': 'us-east-1', 'records': [{'recordId': '49612811534049402823879335600677040555309725205909209090000000', 'approximateArrivalTimestamp': 1605822934247, 'data': ...}
@saumehta9
Copy link
Contributor

Hello @ebaizel,

Thanks for reaching out.
I just re checked the sample, it seems to work fine.
The event object was something like this - {'Records': [{'kinesis': {'kinesisSchemaVersion': '1.0', 'partitionKey': .......

I guess you are using a kinesis data firehose, whereas the sample here is for kinesis data stream. I guess that could be the reason for error (firehose event object maybe different).

@aurghob33
Copy link

Hi @ebaizel ,
I'm closing out this issue as there has been no response for more than 1 month.
Please feel free to reopen this issue or a new issue if you have more questions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants