Skip to content

Feature request: Delete bucket files on sls stack remove #55

Description

@Enase

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions