chalice icon indicating copy to clipboard operation
chalice copied to clipboard

Support for SNS Subscription Filter Policies

Open waveFrontSet opened this issue 2 years ago • 2 comments

I couldn't find a way to attach an SNS Subscription Filter Policy to a lambda function with chalice (there's no documentation on this in the SNS Events section and the decorator doesn't seem to have an attribute for this).

Is there a way to do this with chalice?

waveFrontSet avatar Apr 11 '22 11:04 waveFrontSet

I need that too

vadolasi avatar Jul 10 '22 23:07 vadolasi

+1, not only sns filter, but we need sqs filter policy as well something like

@app.on_sns_message(topic='my-demo-topic', filter_policy= "email" in subject)
def notify_email(event):
    app.log.debug("About to send message to email subject: %s, message: %s",
                  event.subject, event.message)
@app.on_sns_message(topic='my-demo-topic', filter_policy= "mobile" in subject)
def notify_mobile_phone(event):
    app.log.debug("About to send message to mobile with subject: %s, message: %s",
                  event.subject, event.message)

@app.on_sns_message(topic='my-demo-topic', filter_policy= "http" in subject)
def notify_http_endpoint(event):
    app.log.debug("notify internal web service to mobile with subject: %s, message: %s",
                  event.subject, event.message)

baotran2207 avatar Mar 22 '23 07:03 baotran2207