Skip to content

Instantly share code, notes, and snippets.

@brianpursley
Last active March 11, 2017 02:53
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 brianpursley/5fedab9e4b6e676b86ca7edc62d97685 to your computer and use it in GitHub Desktop.
Save brianpursley/5fedab9e4b6e676b86ca7edc62d97685 to your computer and use it in GitHub Desktop.
AWS Lambda function that publishes to SNS
var AWS = require("aws-sdk");
exports.handler = (event, context, callback) => {
var sns = new AWS.SNS();
sns.publish({
Message: 'YOUR MESSAGE HERE',
Subject: 'YOUR SUBJECT HERE',
TopicArn: 'YOUR SNS TOPIC ARN HERE'
}, function() {
callback(null, {
'statusCode': 200,
'headers': {},
'body': null
});
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment