Amazon API Gateway REST API to AWS Lambda to Amazon SNS

API Gateway REST API → AWS Lambda → Amazon SNS

Create an Amazon API Gateway REST API that calls AWS Lambda and Amazon SNS.

This sample project demonstrates how to publish to a SNS Topic whenever the REST API is invoked using Lambda function.
This pattern deploys a Amazon API Gateway REST API with Lambda Function integration and SNS Topic.

< 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-lambda-sns

Deploy

sam deploy --guided


Testing

See the GitHub repo for detailed 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:

Sanskar Sanyal

Sanskar Sanyal

Sanskar is a Serverless Cloud Engineer at Amazon Web Services and is based in India. Sanskar has avid interest in microservices and serverless patterns.

Follow on LinkedIn