I'm trying to simply list all the files in an S3 bucket using Lambda
The code looks as follows:
var AWS = require('aws-sdk');
var s3 = new AWS.S3();
exports.handler = (event, context, callback) => {
s3.listObjectsV2({
Bucket: "bucketname",
}, function(err, data) {
console.log("DONE : " + err + " : " + data);
callback(null, 'Hello from Lambda');
});
};
Using the above, I never get the "DONE" printed at all. The log doesn't show any information except for the fact that it timed out.
Is there any troubleshooting I could do here? I would've thought that at least the error would've been shown in the "DONE" section.