Lambda Function: Configuration
Learn to set up Lambda functions to work seamlessly with DynamoDB.
We'll cover the following...
We've created the DynamoDB table to store the inventory information. We also have the logic for the Lambda handler. Now, let's add the Lambda function to our serverless.yml
.
import { APIGatewayProxyEvent, APIGatewayProxyResult } from "aws-lambda"; export const hello = async ( event: APIGatewayProxyEvent ): Promise<APIGatewayProxyResult> => { return { statusCode: 200, body: JSON.stringify({ message: "Welcome to the Sweet Factory!", input: event, }), }; };
Project
In the code below, in our hello
function (within the functions
section), we'll add the ...