MJJames
MJJames

Reputation: 745

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?

Upvotes: 11

Views: 4379

Answers (1)

user1309272
user1309272

Reputation: 1520

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.

Upvotes: 3

Related Questions