SNS filter policy based on cloudwatch alarm


How can I setup an sns filter policy for different CW alarms? Say If i wanted to only receive certain alarms instead of all that are pushed. I saw that we can use payload-based message filtering but not sure how to configure it. Is there a way to base if off alarm arn?

2 Answers
Accepted Answer

Works if SNS subscription is EMAIL-JSON Protocol. Can filter using the “message body” policy scope.

ex: { "AlarmName": [ "IAM_Policy_Changes_Alarm", "No_MFA_Console_Signin_Alarm", "Config_Changes_Alarms" ] }

answered 9 months ago

Yes. You can now use payload-based message filtering for SNS subscriptions. Based on these sample CW alarms you can easily set up alarm arn based payload filtering like

{"resources":["give your alarm arn here"]}
answered a year ago
  • tried, but didn't work. wasn't able to get any messages after applying a policy with that code

  • Can you post the event which is getting fired by CW as a result of alarm ? Does it have resources field in it ??

  • How can I view the events getting fired by CW?

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions