I am using following code to ingest data to DynamoDB.
Code to read from Kinesis
var AWS = require("aws-sdk"),
DOC = require("dynamodb-doc");
docClient = new DOC.DynamoDB();
function upsert(result) {
var info = new Info(result);
console.log('Within upsert :', info.AcctNo);
docClient.putItem({
TableName: "test_lamda_dynamo_table",
Item: info
}, function(err, data) {
if (err) {
console.error('error', err);
context.done('error', err);
} else {
console.log('success', data);
context.done('success', event.Records);
}
});
}
I am not able to see error handler sysouts in cloudwatch logs as well as I am not able to see data in DynamoDB.
Below are sample logs from cloudwatch
"Within upsert Info: 1234456"
I am not able to see any error logs related to PutItem function in cloudwatch lambda function logs.
Please suggest what I am doing wrong here.
console.loggives youdocClientis initialized and you can put something into another table, just to check?