Greetings! In the previous post , I described how to create a serverless REST API using the serverless framework in which we discussed the project setup and the create operation. In this post, we will complete other operations of our API. You can find the complete source code here . Read Item(s) As we created an item in our previous post, we had to check the value using the AWS console. Now it is time to access items via the REST endpoint. Get all books/items When we define APIs for fetching, we use the "get" HTTP method. As we select all the books, we use the DynamoDB scan command hence we need to allow access to it. Get all handler definition getBooks: handler: src/get-books.handler iamRoleStatements: - Effect: Allow Action: - dynamodb:Scan Resource: !GetAtt crudDynamoDBTable.Arn events: - http: path: /books method: get cors: true Get all handler implementation Create a ne...
May all beings be happy, be well, be peaceful, and be free