Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using AWS Lambda to watch SNS topic and deliver by websocket?

For testing/debugging purposes, I would create a web app that emulates the functionality of one of the 3rd party actors in our system. It should be able to publish and subscribe to messages sent on the AWS SNS service.

I was planning to make a ReactJS web app that calls an API made in AWS Lambda. Sending messages should be fine, with some buttons in the app, calling a Lambda that publishes SNS messages to a topic.

But what about monitoring the messages sent to the relevant topics that I want to watch? I was thinking about using a websocket that could receive messages. I know I can trigger a Lambda with SNS messages, but how do I make the lambda deliver these messages to the websocket? is that possible at all without having a permanent server session running? Should I combine with other things in the AWS toolbox?

like image 785
Esben von Buchwald Avatar asked Oct 29 '17 11:10

Esben von Buchwald


1 Answers

When I originally wrote this answer websocket support for Lambda was not available, but it is now: https://aws.amazon.com/blogs/compute/announcing-websocket-apis-in-amazon-api-gateway/

like image 96
Mark B Avatar answered Sep 22 '22 03:09

Mark B