The automatically generated code for an AWS Lambda function using the Ruby 2.5 runtime looks like this:
require 'json'
def lambda_handler(event:, context:) (1)
# TODO implement
{ statusCode: 200, body: JSON.generate('Hello from Lambda!') } (2)
end
1 | The lambda_handler function has two parameters:
|
||||||||||||
2 | The handler should return a hash from which the HTTP response will be constructed.
|