Sin embargo, intento ejecutar un BatchGetItem de Lambda a DynamoDB. Cuando ejecuto la consulta, devuelve una respuesta nula y no registra ningún problema. PK (Clave principal) y SK (Clave de clasificación) existen en la tabla y los valores asociados con cada uno se almacenan actualmente en la tabla como se ve a continuación. La función Lambda tiene permisos para ejecutar BatchGetItem en esa tabla específica y cuando ejecuto un solo GetItem en esa misma tabla, funciona bien y devuelve un solo elemento. Cualquier ayuda para intentar que BatchGetItem devuelva los elementos consultados sería muy apreciada. Gracias
// Load the AWS SDK for Node.js var AWS = require('aws-sdk'); // Set the region AWS.config.update({region: 'us-east-1'}); // Create DynamoDB service object var ddb = new AWS.DynamoDB({apiVersion: '2012-08-10'}); var info; exports.handler = async (event, context) => { var params = { RequestItems: { "candidates": { Keys: [ { "PK": {S: "jack"}, "SK": {S: "C108951642"} }, { "PK": {S: "ben"}, "SK": {S: "C143956179"} }, { "PK": {S: "hill"}, "SK": {S: "C268283233"} } ], ProjectionExpression: "Name" } } }; ddb.batchGetItem(params, function(err, data) { if (err) { console.log("Error", err); } else { data.Responses.TABLE_NAME.forEach(function(element, index, array) { console.log(element); info = element; }); } }); return info; } Test Event Name batch Response null Function Logs START RequestId: a411114a-29b9-4f7f-bc20-2a5caff9f0cf Version: $LATEST END RequestId: a411114a-29b9-4f7f-bc20-2a5caff9f0cf REPORT RequestId: a411114a-29b9-4f7f-bc20-2a5caff9f0cf Duration: 442.11 ms Billed Duration: 443 ms Memory Size: 128 MB Max Memory Used: 78 MB Request ID a411114a-29b9-4f7f-bc20-2a5caff9f0cf