aws cli delete s3 bucket code example
Example 1: nodejs aws s3 bucket delete item
var params = { Bucket: 'your bucket', Key: 'your object' };
s3.deleteObject(params, function(err, data) {
if (err) console.log(err, err.stack); // error
else console.log(); // deleted
});
Example 2: how to delete a folder from aws s3 bucket using commands
aws s3 rm s3://test-bucket --recursive --exclude="*" --include="data/*.*"