Amazon EventBridge to Amazon SNS

EventBridge → SNS

Create an EventBridge rule that invokes an SNS topic.

This CDK template deploys a SNS topic that is triggered by an EventBridge rule. The SNS topic policy provides the permission for EventBridge to invoke 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-cdk

Deploy

See the GitHub repo.


Testing

Use the AWS CLI to send a test event to EventBridge:
1. Send an event to EventBridge: aws events put-events --entries file://event.json.
2. Retrieve the message from the SQS queue, using the queue URL from the AWS SAM deployment outputs: aws sqs receive-message --queue-url ENTER_YOUR_QUEUE_URL.

Cleanup

1. Delete the stack: npx cdk destroy.
2. Confirm the stack has been deleted: aws cloudformation list-stacks --query "StackSummaries[?contains(StackName,'STACK_NAME')].StackStatus".
3. You see a message confirming DELETE_COMPLETE.

Created by:

Sanket Shinde

Sanket Shinde

Sanket is a Data Engineer at AWS Professional Service.