Amazon API Gateway REST API to AWS Lambda

API Gateway HTTP API → AWS Lambda

Create an Amazon API Gateway REST API with request validation.

This pattern deploys an Amazon API Gateway REST API with a request validator and a default route integrated with an AWS Lambda function written in Node.js. The request validator is used to validate query string, header and request body passed on each REST API call. The lambda function returns a basic response when all validations are passed and when any validation fails API will return a response.

< Back to all patterns

GitHub icon Download this pattern (.zip)

GitHub icon View this pattern on GitHub


Launch Stack

Clone repo

git clone https://github.com/aws-samples/serverless-patterns/cd serverless-patterns/apigw-lambda-request-validator

Deploy

sam deploy --guided


Testing

See the repo for testing instructions.

Cleanup

1. Delete the stack: sam delete --stack-name STACK_NAME.
2. Confirm the stack has been deleted: aws cloudformation list-stacks --query "StackSummaries[?contains(StackName,'STACK_NAME')].StackStatus"

Created by:

Sudheer Yalamanchili

Sudheer Yalamanchili

Sudheer is a cloud application architect working with AWS ProServ.