Skip to content

Instantly share code, notes, and snippets.

@jinman
Last active August 2, 2016 19:15
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jinman/75367fc8466753ccbe45 to your computer and use it in GitHub Desktop.
Save jinman/75367fc8466753ccbe45 to your computer and use it in GitHub Desktop.
LambdaToIoTHTTP
var aws = require('aws-sdk');
var iot = = new AWS.Iot();
var iotData = = new AWS.IotData();
exports.handler = function(event, context) {
// Exercising an IoT Data operation as an example
var params = {
"topic" : "foo/bar",
"payload" : "hello world"
};
iotData.publish(params, function(err, data) {
console.log(err.stack, data);
context.done();
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment