Posted On: Apr 26, 2021

Amazon Simple Notification Service (Amazon SNS) message filtering lets you simplify your pub/sub messaging architecture by offloading message filtering logic from your subscriber systems as well as message routing logic from your publisher systems. Amazon SNS message filtering offers a set of matching operators, which enables you to filter messages based on their attribute keys or attribute values.

Amazon SNS is introducing the following matching operators:

  • [{"exists": false}] - Use this operator to deliver only the messages that don't carry the specified attribute key. For more information, see Attribute key matching in the Amazon SNS Developer Guide.
  • [{"anything-but": {"prefix":"..."}}] - Use this operator to deliver only the messages that carry an attribute with the specified key and whose string value doesn't start with the given prefix. For more information, see Using a prefix with the anything-but operator in the Amazon SNS Developer Guide.
  • [{"cidr": "..."}] - Use this operator to deliver only the messages that carry an attribute with the specified key and whose string value matches IP addresses in the provided network. This operator follows to the Classless Inter-Domain Routing (CIDR) notation. For more information, see IP address matching in the Amazon SNS Developer Guide.

With Amazon SNS, you can use message filtering operators for application-to-application (A2A) and application-to-person (A2P) communication workloads. For more information, see Message filtering and Subscription filter policies in the Amazon SNS Developer Guide.