Reputation: 1436
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
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
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