Reputation: 1
I'm using 'aws-sdk' gem.
https://github.com/aws/aws-sdk-ruby
Using below gem
'aws-sdk (1.11.0)'
I want to use filtering messages function.
https://docs.aws.amazon.com/sns/latest/dg/message-filtering.html
I understood I should set Filter policy.
but, I could not find how to set it.
I have read below.
https://docs.aws.amazon.com/sdk-for-ruby/v3/developer-guide/sns-examples.html https://docs.aws.amazon.com/sdk-for-ruby/v3/api/index.html
How can I use this function?
Thank you.
Upvotes: 0
Views: 492
Reputation: 1
I could set FilterPolicy using set_subscription_attributes.
DeliveryPolicy and RawMessageDelivery were valid attribute names in the description of this page, and FilterPolicy could be used too.
params = {subscription_arn: subscription_arn, attribute_name: 'FilterPolicy', attribute_value: '{"event_type": ["order_placed", "order_cancelled"]}'}
client.set_subscription_attributes(params)
Upvotes: 0