{"repo":"claygregory/serverless-prune-plugin","free":true,"listed":false,"github":"https://github.com/claygregory/serverless-prune-plugin","clone":"git clone https://github.com/claygregory/serverless-prune-plugin.git","description":"Serverless Framework plugin to reap unused versions of deployed functions from AWS","language":"JavaScript","stars":367,"topics":["serverless","serverless-framework","aws-lambda"],"license":"MIT","category":"deployment-docker-iac","readme_excerpt":"Serverless Prune Plugin Following deployment, the Serverless Framework does not purge previous versions of functions from AWS, so the number of deployed versions can grow out of hand rather quickly. This plugin allows pruning of all but the most recent version(s) of managed functions from AWS. This plugin is compatible with Serverless 1.x and higher. Installation Install with npm : And then add the plugin to your serverless.yml file: Alternatively, install with the Serverless plugin command (Serverless Framework 1.22 or higher): Usage In the project root, run: This will delete all but the n -most recent versions of each function deployed. Versions referenced by an alias are automatically preserved. Single Function A single function can be targeted for cleanup: Region/Stage The previous usage examples prune the default stage in the default region. Use --stage and --region to specify: Automatic Pruning This plugin can also be configured to run automatically, following a deployment. Configuration of automatic pruning is within the custom property of serverless.yml . For example: To run automatically, the automatic property of prune must be set to true and the number of versions to keep must be specified. It is possible to set number to 0 . In this case, the plugin will delete all the function versions (except $LATEST); this is useful when disabling function versioning for an already-deployed stack. Layers This plugin can also prune Lambda Layers in the same manner that it prunes","default_branch":null,"files":null,"tree":[],"storefront":"/r/claygregory","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/claygregory/serverless-prune-plugin/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}