Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
const AWS = require('aws-sdk');
const S3 = new AWS.S3({'region':'us-east-1'});
exports.handler = (event, context, callback) => {
let params = {
'Bucket': 'sde',
'Prefix': 'a/b/c/',
'StartAfter':'a/b/c/' // a/b/c/配下だけを取得する
}
S3.listObjectsV2(params, function(err, data) {
data.Contents.forEach(function(elem){
console.log(elem.Key);
});
response = data.Contents;
callback(null, response);
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment