Today, Amazon announced that AWS Lambda functions can be subscribed to Amazon SNS topics.
This means that any message posted to an SNS topic can trigger the execution of custom code you have written, but you don’t have to maintain any infrastructure to keep that code available to listen for those events and you don’t have to pay for any infrastructure when the code is not being run.
This is, in my opinion, the first time that Amazon can truly say that AWS Lambda is event-driven, as we now have a central, independent, event management system (SNS) where any authorized entity can trigger the event (post a message to a topic) and any authorized AWS Lambda function can listen for the event, and neither has to know about the other.
Making this instantly useful is the fact that there already are a number of AWS services and events that can post messages to Amazon SNS. This means there are a lot of application ideas that are ready to be implemented with nothing but a few commands to set up the SNS topic, and some snippets of nodejs code to upload as an AWS Lambda function.
Unfortunately…
I was unable to find a comprehensive list of all the AWS services and events that can post messages to Amazon SNS (Simple Notification Service).
I’d like to try an experiment and ask the readers of this blog to submit pointers to AWS and other services which can be configured to post events to Amazon SNS. I will collect the list and update this blog post.
Here’s the list so far:
Auto Scaling can post events to SNS when instances are launched or terminated. http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/ASGettingNotifications.html
GitHub can post repository events to SNS. “Settings” / “Webhooks & Services”
RDS (instance, security and parameter group and snapshots) can post to SNS topics. http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Events.html
S3 can post messages to SNS when a Reduced Redundancy Storage (RRS) object is lost.http://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html
S3 can post messages to SNS when a new object is added to a bucket and when an existing object is updated. http://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html
AWS CloudWatch (Logs) can trigger SNS messages. [TBD: specific event descriptions? links?]
You can either submit your suggestions as comments on this blog post, or tweet the pointer mentioning @esh
Thanks for contributing ideas:
Anonymous commenter
[2015-04-13: Updated with input from comments and Twitter]
Original article and comments: https://alestic.com/2015/04/aws-lambda-sns/