Search code examples
amazon-web-servicesamazon-sqsamazon-snssubscription

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


Solution

  • 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.