2 回答
- 最新
- 投票最多
- 评论最多
0
I don't know the precise nature of the issue, but refactoring it to use asyc seemed to solve the issue.
var AWS = require("aws-sdk");
var DC = new AWS.DynamoDB.DocumentClient();
console.log('Loading function');
exports.handler = async (event, context) => {
for (const record of event.Records) {
console.log(record.eventID);
if (record.eventName == 'MODIFY')
{
var input = record.dynamodb.NewImage;
var _delete = input.Delete.N;
if ( _delete == 1 )
{
const putParams = {
TableName: 'TableToCopyTo',
Item: AWS.DynamoDB.Converter.unmarshall(input)
};
try {
const data = await DC.put(putParams).promise();
console.log(data);
}
catch (err)
{
console.log(err);
}
}
}
}
};
已回答 4 年前
相关内容
- AWS 官方已更新 3 年前