Following lambda function is timing out (called via WSS API Gateway) Similar calls have worked on local DynamoDB
'''
var AWS = require("aws-sdk");
var docClient = new AWS.DynamoDB.DocumentClient({
region: "ap-south-1",
httpOptions: {
timeout: 5000
},
maxRetries: 3
});
exports.handler = async function(event, context)
{
console.log("Entering handler");
try
{
var params =
{
TableName : "meeting_info",
Key:{
"meeting_id" :"100-200-300"
}
};
try
{
var data = await docClient.get(params).promise();
console.log(data);
} catch (e) {
console.error(e);
}
}
catch (err)
{
console.error("meeting_connections",err);
return { statusCode: 500.4, body: 'Failed to connect: ' + JSON.stringify(err) };
}
return { statusCode: 200, body: 'Connected' };
};
'''
Following are the corresponding CloudWatch logs.
START RequestId: 234b8e95-0555-45d6-811f-c6fa4d354e61 Version: $LATEST
2020-11-22T19:11:23.781Z 234b8e95-0555-45d6-811f-c6fa4d354e61 INFO Entering handler
END RequestId: 234b8e95-0555-45d6-811f-c6fa4d354e61
REPORT RequestId: 234b8e95-0555-45d6-811f-c6fa4d354e61 Duration: 10010.57 ms Billed Duration: 10000 ms Memory Size: 128 MB Max Memory Used: 85 MB Init Duration: 403.44 ms
2020-11-22T19:11:33.790Z 234b8e95-0555-45d6-811f-c6fa4d354e61 Task timed out after 10.01 seconds