- Notifications
You must be signed in to change notification settings - Fork4
Serverless Framework plugin that empties S3 buckets before removing a stack
License
coyoteecd/serverless-s3-cleaner
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Serverless Framework plugin that empties an S3 bucket before removing a deployed stack.Replacement forserverless-s3-remover which is no longer maintained.
npm install serverless-s3-cleaner --save-dev
Version 1.0.2 is compatible with Serverless Framework v3, but it uses the legacy logging interface. Version 2.0.0 and later uses thenew logging interface.
serverless-s3-cleaner | Serverless Framework |
---|---|
≤ v1.0.1 | v1.x, v2.x |
v1.0.2 | v1.x, v2.x, v3.x |
≥ v2.0.0 | v3.x |
Add the following to yourserverless.yml
:
plugins: -serverless-s3-cleanercustom:serverless-s3-cleaner:# (optional) Whether to prompt before emptying a bucket. Default is 'false'.prompt:false# Names of buckets to remove before a stack is removed, or via 'sls s3remove' commandbuckets: -bucketName1 -bucketName2# (optional) Buckets to remove before a stack is deployed.bucketsToCleanOnDeploy: -oldBucketName
When removing a Serverless Framework stack, this plugin automatically empties the buckets listed underbuckets
option.
When deploying a Serverless Framework stack, this plugin automatically empties the buckets listed underbucketsToCleanOnDeploy
option.Use this when renaming or removing a bucket (put here the old bucket name) to avoid deployment errors when CloudFormation tries to remove the old bucket.
You can also empty a bucket explicitly by running:
sls s3remove
Buckets with versioning enabled are supported. When emptying a bucket, all object versions and delete markers are deleted.
The plugin requires the following permissions to be given to the role that Serverless runs under, for all the affected buckets:
- s3:ListBucket
- s3:ListBucketVersions
- s3:DeleteObject
- s3:DeleteObjectVersion
About
Serverless Framework plugin that empties S3 buckets before removing a stack
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors2
Uh oh!
There was an error while loading.Please reload this page.