Amazon EventBridge to Amazon SNS

EventBridge → SNS

Create an EventBridge rule that invokes an SNS topic

The AWS SAM template deploys an SNS topic that is triggered by an EventBridge rule. The SNS topic policy provides the permission for EventBridge to invoke the SNS topic.
In this example, the EventBridge rule specified in template filters the events based upon the criteria in the EventPattern section. When matching events are sent to EventBridge that trigger the rule, they are delivered as a JSON event payload to the 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/eventbridge-sns-terraform

Deploy

See the GitHub repo for detailed deployment instructions.


Testing

1. Subscribe your email address to the SNS topic: aws sns subscribe --topic-arn ENTER_YOUR_TOPIC_ARN --protocol email-json --notification-endpoint ENTER_YOUR_EMAIL_ADDRESS
2. Click the confirmation link delivered to your email to verify the endpoint.
3. Send an event to EventBridge:
aws events put-events --entries file://event.json
The event is delivered to your email address.

Cleanup

1. Change directory: cd eventbridge-sns-terraform.
2. Delete the stack: terraform destroy.
3. Confirm the stack has been deleted: terraform show.

Created by:

Ahmad Aboushady

Ahmad Aboushady

Senior Technical Account Manager, AWS