Amazon SNS to AWS Lambda

SNS → AWS Lambda

Create a Lambda function that subscribes to an SNS topic

This pattern contains a sample AWS CDK stack to create a Lambda Function, a SNS Topic and the IAM permissions required to run the application. SNS invokes the Lambda function when new messages are available. When messages are sent to the SNS topic, they are delivered as a JSON event payload to the Lambda function.

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

Deploy

cdk deploy


Testing

See the 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:

Helton Henrique Ribeiro

Helton Henrique Ribeiro

Helton is a Cloud Application Architect at AWS.

Follow on LinkedIn