How do I troubleshoot subscription filter policy issues in Amazon SNS?
Last updated: 2021-08-26
My Amazon Simple Notification Service (Amazon SNS) subscription filter policy isn't working. How do I troubleshoot the issue?
Important: Additions or changes to a subscription filter policy require up to 15 minutes to take effect.
Verify that message attributes are included in the messages published to your Amazon SNS topic
To see if your filter policy rejected messages because they didn't include attributes, review the following metric in your Amazon CloudWatch metrics for Amazon SNS:
For more information, see Amazon SNS message filtering. For a tutorial on how to send messages with attributes, see To publish messages to Amazon SNS topics using the AWS Management Console.
Verify that the messages published to your Amazon SNS topic meet the required filter policy constraints
For a complete list of restraints, see Filter policy constraints.
Verify that your subscription filter policy's attributes are configured correctly
After you define a subscription filter policy's attributes, the subscription endpoint receives only messages that include those defined attributes. For more information see, Attribute string value matching and Attribute numeric value matching.
To see the messages that your filter policy rejected because of mismatching or incorrectly formatted attributes, review the following CloudWatch metrics for Amazon SNS:
Note: The NumberOfNotificationsFilteredOut metric shows messages that your filter policy rejected because the message attributes didn’t match the policy attributes. The NumberOfNotificationsFilteredOut-InvalidAttributes metric shows messages that your filter policy rejected because the message attributes weren't in a valid format.