2 réponses
- Le plus récent
- Le plus de votes
- La plupart des commentaires
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);
}
}
}
}
};
répondu il y a 4 ans
Contenus pertinents
- demandé il y a un an
- demandé il y a 2 mois
- AWS OFFICIELA mis à jour il y a 3 ans
- AWS OFFICIELA mis à jour il y a 8 mois
- AWS OFFICIELA mis à jour il y a 4 mois