Get startedGet started for free

Creating and running Lambda functions

1. Creating and running Lambda functions

In the AWS console, go to Services, AWS Lambda. Select functions in the left sidebar, then create function. Call the function recordReaderS3 and set the runtime as Python 3.8 Expand "Choose or Create Execution Role". Lambda will create a role for itself with basic permissions to write to CloudWatch logs, but we can add more later. After creating the function, we see the main configuration page. The top section - the designer - gives us a nice visual representation of triggers and destinations. Let's collapse it for now. Below the designer, we have the code editor with a sample Hello World function. Change the function name to record_created_handler and add a statement to print the event. Update the handler field with the new handler name in the format filename.function_name. Save the function and click test. Lambda asks you to configure a test event which will be sent to the event argument. We will customize the Amazon S3 Put Template provided by AWS. Select it, and name the new sample event sampleFirehosePut. Click test again, selecting sampleFirehosePut event. At the bottom of the screen, a console appears with the function return and log, including the print statement. The green success box on top contains a prettier version of the console output.

2. Let's practice!