REST API via Amazon API Gateway, acting as Amazon SNS proxy with Amazon SNS Filter Policy

Amazon API Gateway REST API → Amazon SNS → AWS Lambda function → AWS Lambda function

REST API via API Gateway as an SNS proxy, triggering Lambda functions with MessageBody filtering.

This pattern leverages the Serverless Framework to deploy a REST API via Amazon API Gateway, functioning as an Amazon SNS proxy. It incorporates SNS Filter Policy for triggering Lambda functions based on MessageBody filters. Additionally, it enables CloudWatch Logs and X-Ray tracing for both API Gateway and Lambda through the Powertools for AWS Lambda developer toolkit.

< Back to all patterns

GitHub icon Download this pattern (.zip)

GitHub icon View this pattern on GitHub


Clone repo

git clone https://github.com/aws-samples/serverless-patterns/cd serverless-patterns/apigw-sns-filter-policy-lambda-sls-py

Deploy

sls deploy --verbose


Testing

See the GitHub repo for detailed testing instructions.

Cleanup

Delete the stack: sls remove --verbose.

Created by:

Balasubrahmanya Balakrishna

Balasubrahmanya Balakrishna

Senior Lead Software Engineer, Capital One Services, LLC.

Follow on LinkedIn