New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

serverless-s3-cleaner

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

serverless-s3-cleaner

Serverless Framework plugin that empties S3 buckets before removing a stack

  • 2.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

serverless-s3-cleaner

serverless license build status npm version

Serverless Framework plugin that empties an S3 bucket before removing a deployed stack. Replacement for serverless-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 the new 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 your serverless.yml:

plugins:
  - serverless-s3-cleaner

custom:
  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' command
    buckets:
      - 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 under buckets option.

When deploying a Serverless Framework stack, this plugin automatically empties the buckets listed under bucketsToCleanOnDeploy 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

Keywords

FAQs

Package last updated on 08 Dec 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc