Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Serverless Framework plugin that empties S3 buckets before removing a stack

License

NotificationsYou must be signed in to change notification settings

coyoteecd/serverless-s3-cleaner

Repository files navigation

serverlesslicensebuild statusnpm version

Serverless Framework plugin that empties an S3 bucket before removing a deployed stack.Replacement forserverless-s3-remover which is no longer maintained.

Installation

npm install serverless-s3-cleaner --save-dev

Compatibility with Serverless Framework

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-cleanerServerless Framework
≤ v1.0.1v1.x, v2.x
v1.0.2v1.x, v2.x, v3.x
≥ v2.0.0v3.x

Usage

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

Versioning

Buckets with versioning enabled are supported. When emptying a bucket, all object versions and delete markers are deleted.

IAM Permissions

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

Stars

Watchers

Forks

Packages

No packages published

Contributors2

  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp