Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const emptyBucket = async (event) => {
const requestType = get(event, 'RequestType');
if (requestType === 'Delete') {
const Bucket = get(event, 'ResourceProperties.BucketName');
if (Bucket === undefined) {
throw new Error('No Bucket Provided.');
}
await s3.emptyBucket({ Bucket });
logger.info(`${Bucket} emptied!`);
}
};