Skip to content

Instantly share code, notes, and snippets.

@aa2kb
Created November 27, 2018 12:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aa2kb/e842147829b774110f9bcdbf9d57e94d to your computer and use it in GitHub Desktop.
Save aa2kb/e842147829b774110f9bcdbf9d57e94d to your computer and use it in GitHub Desktop.
var AWS = require('aws-sdk');
exports.handler = async (event) => {
try {
var snsParameters = {
TopicArn: process.env.SNS_TOPIC,
Message: JSON.stringify(event,null,2)
};
return await new AWS.SNS({ apiVersion: '2010-03-31' }).publish(snsParameters).promise();
}
catch (e) {
throw(e);
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment