Create Methods

Create GET API (List)

  1. Select /books resource, then click Create method CreateListAPI

  2. On Create method page:

    • Select method GET
    • Select Lambda function for Integration type
    • Check Lambda proxy integration
    • Enter Lambda function name: books_list
    • Click Create method CreateListAPI
  3. Review the information and click Create method CreateListAPI

  4. Method GET created successfully. Continue to create POST method by clicking Create method CreateListAPI

Create POST API (Write)

  1. On Create method page:

    • Select method POST
    • Select Lambda function for Integration type
    • Check Lambda proxy integration
    • Enter Lambda function name: book_create
    • Click Create method CreateWriteAPI
  2. Review the information and click Create method CreateWriteAPI

  3. Method POST created successfully. Continue to create {id} resource for delete API

    • Click Create resource CreateWriteAPI

Create DELETE API

  1. On Create resource page:

    • Select /books for Resource path
    • Enter {id} for Resource name
    • Click Create resource CreateDeleteAPI
  2. Resource /{id} created. Select this resource and click Create method CreateDeleteAPI

  3. On Create method page:

    • Select method DELETE
    • Select Lambda function for Integration type
    • Check Lambda proxy integration
    • Enter Lambda function name: book_delete
    • Click Create method CreateDeleteAPI
  4. Review the information and click Create method CreateDeleteAPI

So we have created the APIs that interact with Lambda functions.