Posts

Showing posts from April, 2021

AWS API Gateway with Lambda: add "Get By ID" definition

Image
This thing is not trivial and I didn't found any simple explanation about this. So that is  select an existing resource (eg. "users") click on "Actions" dropdown and select "Create Resource" in " Resource Name " put parameter name in curly braces (eg. {userid}) in " Resource Path " you should see read-only text " /users/ " and textbox for parameter write {userid} in this textbox and click " Create Resource " you should see a new branch in your API tree - /{userid} . Select it. click  "Create Resource"-"Create Method" and add ANY method there integrate it with Lambda function you alrteady used for ANY of this resource (don't forget check " Use Lambda Proxy integration ") select this new brand ANY method, go to "Method Request" and ensure that there is "userid" parameter in "Request Paths" section That is it. Now you should handle it in your Lambda (to