KeyError: 'Records' while trying to read CSV file from S3 bucket - Lambda trigger

The error happens because you are using Test in AWS console. In that case some default event is provided. For your code you have to provide valid S3 event for your use-case. The S3 event structure is given here so you have to setup your Test to use valid event structure.

Alternatively, you can use AWS console provided events:

enter image description here