Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

EventBridge with SNS Target, can you customize the SNS Message

I'm trying to use AWS EventBridge with an SNS Target and I've got the basic integration of sending a basic message SNS, with input transformers. However I want to be able to set the SNS Message Attributes (for subscription filtering) and ideally provide the Message as JSON so the message is different per SNS subscription (SMS , Email) etc.

Is this even possible? I've been unable to find a definitive documentation page indicating the scope of what the EventBridge and SNS Target supports. Is it only a basic message?

I could achieve this by using Event Bridge => Lambda => SNS but I'm trying to avoid the extra hop. Does anyone have any definitive information on what the SNS Target officially supports for Event Bridge?

like image 864
MJJames Avatar asked Dec 10 '20 16:12

MJJames


People also ask

Can SNS send to EventBridge?

Amazon EventBridge currently supports over 15 AWS services as targets, including AWS Lambda, Amazon SQS, Amazon SNS, and Amazon Kinesis Streams and Kinesis Data Firehose, among others.

Can SNS store messages?

Increase durability with message archiving, delivery retries, and DLQ. Amazon SNS stores each message published across geographically-separated data centers. If a subscribed system isn't available, Amazon SNS executes a message delivery retry policy.


1 Answers

As far I can search this is unsupported. It would have to live in a special section for SNS here: https://docs.aws.amazon.com/eventbridge/latest/APIReference/API_PutTargets.html

I think the answer for my use case is actually instead of managing this behavior with SNS topic filtering, we let Eventbridge route to the specific queue. This does make some things different (generic event log queue), but functionally I'm reaching the goal I had which is to get specific events into a specific SQS queue for managed background processing. If I need these events in two queues, I can either publish to SNS (generic no attributes), or N number of SQS targets to meet my use case.

like image 167
user1309272 Avatar answered Dec 25 '22 04:12

user1309272