I'm trying to get the result of an invoked Lambda function.
I invoked it with AWS IoT and don't know how to get the message back to AWS IoT.
For this I did a small Node.js code which just adds two numbers and should return the result with the callback. The function is invoked correctly, because it writes the sum to CloudWatch.
All in all, my question is how can I get my result back to AWS IoT? Have I already gotton this with the callback and how can I access it? I am new to AWS and don't understand the callback logic correctly.
Here is my Lambda function code:
'use strict'
exports.handler = (event, context, callback) => {
let number1 = event.number1;
let number2 = event.number2;
let sum = number1 + number2;
console.log('Sum: ' + sum);
callback(null, sum);
};
P.S. I already tried JSON.stringify for the sum but it didn't work.