Skill 4.3.4

Use subscription filter policies to optimize messaging

Key Concepts

A filter policy is a JSON document on a subscription that matches message attributes (the default) or, with the filter policy scope set to MessageBody, fields in the message body. It supports exact values, prefixes, numeric ranges, anything-but and exists checks. Messages that do not match are not delivered to that subscriber.

Filtering at SNS means consumers no longer receive and discard irrelevant messages, which saves Lambda invocations and SQS requests and simplifies consumer code. EventBridge rules and Lambda event source mapping filters apply the same idea.