Pub/Sub Topic

A Pub/Sub Topic that allows for events to be transmitted in a Fan Out fashion.


Basic Topic

    
from cdev.aws.sns import Topic myTopic = Topic("demo")


Integrating with a Serverless Function

You can use a Serverless Function to respond to the events from a Queue

    
from cdev.aws.topic import Topic from cdev.aws.lambda_function import ServerlessFunction myTopic = Topic("demo") topic_event = myTopic.create_event_trigger() @ServerlessFunction("demofunction", events=[topic_event], permissions=[myTopic.available_permissions.SUBSCRIBE]) def demo(event, context): print(event)