Example – CRUD service
This example demonstrates creating a simple and secure RESTful CRUD service, using the AWS API Gateway along with AWS Cognito, AWS Lambda, and AWS DynamoDB. The following Serverless Framework serverless.yml file fragment defines an API Gateway with a RESTful resource to PUT, GET, and DELETE items. Each of these HTTP methods is mapped to a Lambda function: save, get, and delete, respectively. We also enable Cross-Origin Resource Sharing (CORS) support so that the resource can be accessed from a web application, usually written in React or Angular. To add OAuth 2.0 support, we provide the Amazon Resource Name (ARN) for the AWS Cognito User Pool that is used to authenticate the users. Throttling is provided by default ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access