SNS Subscription with FIlter

Hi,
I would like to subscribe a lambda to an existing Topic, but I don’t want to trigger my lambda on all messages. I know how to apply filter to subscription by AWS Console, but I have no idea how to deploy it by serverless.
Can anyone help me with that?


Thanks
Maciek

@maciek.miekus SNS subscription filter policies are only new to AWS. It’s going to take a while before they’re supported by Serverless. Given that they don’t seem to be supported by CloudFormation it may be a longer wait than usual.

Thanks @buggy for the prompt response, I will try to solve it with AWS CLI.

Is there already an issue open for this so that I can see when you guys are able to implement this?

1 Like

There’s now a plugin for that!

:metal:

2 Likes

It’s been over a year, sorry for bringing this back from the dead but is there any existing support for this? Alternatively, a link to a tracking issue or an example Resource config would be great.

Cheers

2 Likes

This feature seems to be available but does not work.
I created a stackoverflow question… crickets. https://stackoverflow.com/questions/53269342/serverless-sns-filterpolicy-does-not-put-filter-in-place-when-subscription-creat?noredirect=1#comment93463364_53269342

I was able to get the SNS filter policy to work. I responded to @anwarhamr in StackOverflow.