create a Lambda function using a blueprint. A blueprint provides sample code to do some minimal processing. Most blueprints process events from specific event sources, such as Amazon Simple Storage Service (Amazon S3), Amazon DynamoDB, or a custom application.
To create a Lambda function with the console
Open the Functions page of the Lambda console.
Choose Create function.
Select Use a blueprint.
Open the Select blueprint dropdown list and search for Hello world function. Select the nodejs14.x or python3.7 version of the blueprint.
Enter a Function name.
For Execution role, choose Create a new role with basic Lambda permissions. Lambda creates an execution role that grants the function permission to upload logs to Amazon CloudWatch. The Lambda function assumes the execution role when you invoke your function, and uses the execution role to create credentials for the AWS SDK and to read data from event sources.
Invoke the function
To invoke the function from the console, create a test event.
Choose the Test tab.
For Test event action, choose Create new event.
For Event name, enter a name for the test event.
For Event sharing settings, choose Private.
For Template, leave the default hello-world option.
In the Event JSON, replace value1 with hello, world! Don't change key1 or the event structure. Example:
{
"key1": "hello, world!",
"key2": "value2",
"key3": "value3"
}
Choose Save, and then choose Test. Lambda invokes the function on your behalf. The function handler receives and then processes the sample event.
Review the Execution result. Under Details, you should see the value that you entered in step 6: "hello, world!". The execution result also includes the following information:
The Summary section shows the key information from the REPORT line in the invocation log.
The Log output section shows the complete invocation log. Lambda writes all invocation logs to Amazon CloudWatch.
Choose Test to invoke the function a few more times and gather additional metrics that you can view in the next step.
Choose the Monitor tab. This page shows graphs of the metrics that Lambda sends to CloudWatch.
https://docs.aws.amazon.com/lambda/latest/dg/getting-started.html