SNS/SQS fanout with Terraform

With SNS you can easily publish an event and immediately deliver it to topic’s subscribers. With SQS you can decouple services and asynchronously process events. If you connect both services, you will get all benefits together.


Let’s create a SNS topic and two SQS queues.


Everything should be connected.


By default your topic cannot forward message to the queues. You need to add missing permissions to every queue as access policy.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store