Last active
August 2, 2016 19:15
-
-
Save jinman/75367fc8466753ccbe45 to your computer and use it in GitHub Desktop.
LambdaToIoTHTTP
This file contains hidden or 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
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