If you try to remove serverless stack (cmd: sls remove) with bucket resource and bucket is not empty you will get the error:
An error occurred: YOUR_Bucket_NAME - The bucket you tried to delete is not empty (Service: Amazon S3; Status Code: 409; Error Code: BucketNotEmpty;
A way to fix it is serverless-plugin-scripts plugin:
# serverless-plugin-scripts
scripts:
hooks:
'before:remove:remove': aws s3 rm s3://${self:custom.YOUR_Bucket_NAME} --recursive || true
But it would be great if you will add the option that allows to do that.
Thanks.
If you try to remove serverless stack (cmd:
sls remove) with bucket resource and bucket is not empty you will get the error:A way to fix it is
serverless-plugin-scriptsplugin:But it would be great if you will add the option that allows to do that.
Thanks.