Last active
February 20, 2017 16:12
-
-
Save sharpred/d97c4f84b11d957bb1050deaa91065e5 to your computer and use it in GitHub Desktop.
run webtask code with token claims
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
return function (context, cb) { | |
var AWS = require('aws-sdk'); | |
AWS.config.update({ | |
accessKeyId: context.secrets.ACCESS_KEY, | |
secretAccessKey: context.secrets.SECRET_KEY, | |
region: 'eu-west-1' | |
}); | |
var sns = new AWS.SNS(); | |
var params = { | |
Message: 'web token test', | |
TopicArn: context.secrets.TOPIC_ID, | |
Subject: 'web token test' | |
}; | |
sns.publish(params, function (err, data) { | |
if (err) { | |
console.error("error"); | |
cb(null, err); | |
} else { | |
console.log("ok"); | |
cb(null, data); | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment