New pattern submission: SNS to Lambda CDK
To submit a template to the Serverless Patterns Collection, submit an issue with the following information.
To learn more about submitting a pattern, read the publishing guidelines page.
Use the model template located at https://github.com/aws-samples/serverless-patterns/tree/main/_pattern-model to set up a README, template and any associated code.
Description (mid-length e.g. "Create a Lambda function that sends events to EventBridge.")
Create a Lambda function that subscribes to a SNS topic
Language: (optional e.g. "Python", if you have a Lambda function in your example)
Python
YouTube videoId (optional e.g. "VI79XQW4dIM")
N/A
Framework (currently we support SAM or CDK)
CDK
Services from/to (e.g. "Lambda to EventBridge)
SNS to Lambda
Description (this must include a throughout explanation of the pattern together with details of IAM permissioning)
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.
Deployment commands
cdk deploy
GitHub PR for template:
Payload example (e.g. Lambda event payload from source service).
Text message: "Hello world!"
Additional resources (optional: link and anchor text, up to 5 resources)
- Choosing between messaging services for serverless applications
- Using AWS Lambda with Amazon SNS
- aws-cdk/aws-sns module
Author bio
Name: Helton Henrique Ribeiro Photo URL: https://phonetool.amazon.com/users/ribeih LinkedIn: https://www.linkedin.com/in/heltonribeiro/ Description (up to 255 chars): Helton is a Cloud Application Architect at AWS.
Thanks for your contribution - this is now live at https://serverlessland.com/patterns/sns-lambda-cdk.
Please can you update your testing section of the GitHub ReadMe to remove the SAM references.