Following deployment, the Serverless Framework does not have the option to enable termination protection for the CloudFormation stack. This plugin will enable the termination protection. It can also disable it by using a command line option. This plugin is designed for the Serverless Framework 1.x and above.
- Serverless Framework 3.x or greater.
- Node 8.x or greater.
- NPM 6.x or greater.
Use serverless-stack-termination-protection@1
if you need support for Serverless Framework 2.x or below.
Visit the Getting Started with the Serverless Framework to get started with the Serverless Framework.
Install with npm:
npm install -g serverless
Install with npm:
npm install --save-dev serverless-stack-termination-protection
And then add the plugin to your serverless.yml
file:
plugins:
- serverless-stack-termination-protection
See the example(s).
This plugin enables termination protection automatically after the deployment. Simply run the deploy:
sls deploy
This plugin can disable termination protection automatically after the deployment.
Simply run the deploy with the --param option:
sls deploy --param disable-termination-protection
If you are using multiple params, make sure to separate them:
sls deploy --param disable-termination-protection --param some-other-param
You may apply protection for specific stages by listing the stages under a serverlessTerminationProtection custom property in the serverless yaml file.
custom:
serverlessTerminationProtection:
stages:
- prod
Future version will:
- Delete the stack forceably using
sls remove --force
.
Please request features or report problems using the issues page.
See the included LICENSE for rights and limitations under the terms of the MIT license.