knowledge20
knowledge20

Reputation: 1436

Applying Filter policy to SNS subscription

We have created different config rules for different resources in our AWS account. We have enabled the SNS subscription for the alerts. However, I want to add a filter policy to the subscription that it should give the alerts only for one specific configRule.

Can you please help me how to add filter policy for one specific configRule

Upvotes: 2

Views: 2584

Answers (2)

Otavio Ferreira
Otavio Ferreira

Reputation: 966

As of November 2022, you can switch to payload-based message filtering in SNS. You simply need to set a subscription attribute named FilterPolicyScope to MessageBody, whereas its default is MessageAttributes. More info: https://aws.amazon.com/blogs/compute/introducing-payload-based-message-filtering-for-amazon-sns/

Upvotes: 0

Marcin
Marcin

Reputation: 238051

Sadly you can't do this from SNS subscription level. This is because filter policies work only on message attributes, not message body.

The way around this, is to subscribe a lambda function to your SNS topic. The lambda would get the messages from the AWS Config, parse them, and distribute to other msg specific topics or other resources. Since its lambda function, you could program it to do pretty much anything what you want, including rising some alarms.

Upvotes: 3

Related Questions