Completing and deploying the serverless backend
So far, we have successfully created a basic health check endpoint, which has helped you understand how to create Lambda-backed API endpoints. However, the current functionality of our health check endpoint is rather limited, as its name implies. In this section, we will delve deeper into querying and writing data to DynamoDB from the Lambda function handlers, allowing for more complex and useful API endpoints to be built.
Creating a GET and POST route to perform DynamoDB operations
Now that we have our API Gateway properly configured, to perform the same operations and requests we were doing with ECS and RDS, we need to create two more endpoints: one to fetch all data from the DynamoDB table, and another to insert data into it.
In this section, we’ll use our previous knowledge of creating an API Gateway method and integrating it with a Lambda function to create two more Lambdas connected to the DynamoDB table: