In my previous blog I have discussed how to create a REST API endpoints for CRUD functionalities using Amazon API Gateway, AWS Lambda and Amazon DynamoDB, refer this page. You can have these services processed API Gateway has a special feature that uses a Lambda function to control access to your API.

When a request is made to one of the API’s methods, API Gateway makes a call to the Lambda authorizer that takes the caller’s identity as input and returns an IAM policy as output that allows the user to access the API or block the access in case the authorization fails.

Refer to the below image for understanding: If Authorization is enabled, to every request that comes to API Gateway, the token or parameters along with context will be sent to Lambda Auth Function to verify the request, on the basis of which an IAM Policy for Allow access or Deny access will be generated.

Now when I try to access the API with header authorizationToken , the request first reaches to Lambda Authorizer, which validates the token and generates Policies with Allow or Deny effect in order to access the REST API endpoints.

Related Articles