You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Amazon SNS can be used as a mediator to bypass events from other Amazon Web Services to iron-lambda ([Amazon Simple Storage Service (S3)](http://docs.aws.amazon.com/AmazonS3/latest/dev/ways-to-add-notification-config-to-bucket.html) for example)
2
+
3
+
To use Amazon SNS as event source to you lambda function you should the following steps:
4
+
5
+
1. Upload your lambda function with [`iron-lambda deploy`](../../README.md)
6
+
2. On existing SNS topic Create New Subsription with the parameters:
7
+
* Protocol: HTTPS
8
+
* Endpoint: The webhook url for the lambda function (the url is located in _Webhook URL_ field on _Code_ page of the worker created for your lambda function)
9
+
3. Request the confirmation of the new subscription. The confirmation is sent to your lambda function. You should be interested in _SubscribeURL_ in the payload. The payload can be viewed on on _Tasks_ page of the worker.
10
+
4. Confirm subscription by either following the _SubscribeURL_ or entring this URL on _Confirm subscription_ dialog in AWS Management Console.
11
+
5. From this point every message published to topic will be sent to the lambda function in `Message` property of `event` parameter. Optionally, you could parse the message to json (see [example](./lambda.js)).
12
+
13
+
**Note**: For security reason it's desured to validate the incoming message signature. More information can be obtained [here](http://docs.aws.amazon.com/sns/latest/dg/SendMessageToHttp.verify.signature.html)
0 commit comments