Reputation: 14555
Is it possible to use an AWS Lambda to control access to an AWS API Gateway? I would like to trigger a lambda in the beginning of a call to an API Gateway, before the call is made to the underlying API, and from the result of the lambda decide whether to authorize it or not. If this is not possible, what would be, in the AWS stack, a viable alternative?
Upvotes: 1
Views: 413
Reputation: 4302
Custom authorizers in Amazon API Gateway are exactly what you are looking for. The Custom authorizer is a lambda function that is called by API Gateway before the request is passed to the Lambda function that handles the request.
https://aws.amazon.com/blogs/compute/introducing-custom-authorizers-in-amazon-api-gateway/
Upvotes: 3