We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bd47e70 commit 18d63e3Copy full SHA for 18d63e3
functions/notify_to_slack.js
@@ -4,8 +4,23 @@ const notifyToSlack = require('./notify_to_slack/index');
4
5
module.exports.handle = (event, context, callback) => {
6
7
- notifyToSlack(event);
+ let notification = event;
8
+
9
+ if(event.Records[0].Sns) {
10
+ notification = parseSnsEvent(event);
11
+ }
12
13
+ notifyToSlack(notification);
14
callback(null, {});
15
16
};
17
18
+function parseSnsEvent(event) {
19
+ const sns = event.Records[0].Sns;
20
21
+ return {
22
+ Subject: sns.Subject,
23
+ Message: JSON.parse(sns.Message),
24
25
+}
26
0 commit comments