Open Postman to call api.


Open AWS Lambda console.

At books_list page.

At /aws/lambda/books_list page.

Next, we will fix the code to make the function run failed. Copy the following code.
books_data = table.scan(
TableName='Book',
IndexName=secondary_index
)

After books_list is deployed successfully. Recall the API as in step 1, the error returned is Internal server error.

Back to /aws/lambda/books_list CloudWatch Logs page.

At the detailed log page. You could see the error. The error is because we changed TableName=‘Books’ to TableName=‘Book’ (Books is the name of the DynamoDB table that we just created before).
