Skip to content

Commit

Permalink
Update Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
FilipPyrek committed Mar 17, 2020
1 parent bf52ade commit 10e773e
Showing 1 changed file with 28 additions and 11 deletions.
39 changes: 28 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,56 @@
[![NPM](https://nodei.co/npm/serverless-s3-remover.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/serverless-s3-remover/)
[![NPM](https://nodei.co/npm-dl/serverless-s3-remover.png?height=2)](https://nodei.co/npm/serverless-s3-remover/)
# serverless-s3-remover
plugin for serverless to make buckets empty before remove
# @purple/serverless-s3-remover

Plugin for serverless to make buckets empty before remove.

## Original project

[Original project](https://github.com/sinofseven/serverless-s3-remover) is not
maintained anymore, so we published this version under `@purple` organisation.

Main difference between [`serverless-s3-remover`](https://www.npmjs.com/package/serverless-s3-remover) and [`@purple/serverless-s3-remover`](https://www.npmjs.com/package/@purple/serverless-s3-remover)
is ability to empty buckets with enabled versioning.

[`serverless-s3-remover`](https://www.npmjs.com/package/serverless-s3-remover) is not able to empty buckets with enabled versioning.

# Usage

Run next command.

```bash
$ npm install serverless-s3-remover
$ npm install @purple/serverless-s3-remover
```

Add to your serverless.yml

```yaml
plugins:
- serverless-s3-remover
- "@purple/serverless-s3-remover"

custom:
remover:
buckets:
- my-bucket-1
- my-bucket-2
buckets:
- my-bucket-1
- my-bucket-2
```
You can specify any number of `bucket`s that you want.

Now you can make all buckets empty by running:

```bash
$ sls s3remove
```

# When removing
When removing serverless stack, this plugin automatically make buckets empty before removing stack.

When removing serverless stack, this plugin automatically make buckets empty before removing stack.

```sh
$ sls remove
```

# Using Prompt

You can use prompt before deleting bucket.

```yaml
Expand All @@ -49,6 +65,7 @@ custom:
![terminal.png](https://user-images.githubusercontent.com/57114/31264298-0896f1ec-aaa3-11e7-9a8e-86e3c3f34e23.png)
# Populating the configuration object before using it
```yaml
custom:
boolean:
Expand All @@ -58,4 +75,4 @@ custom:
prompt: ${self:custom.boolean.${opt:s3-remover-prompt, 'true'}}
```
I can use the command line argument ```--s3-remover-prompt false``` to disable the prompt feature.
I can use the command line argument `--s3-remover-prompt false` to disable the prompt feature.

0 comments on commit 10e773e

Please sign in to comment.