Serverless Framework plugin that empties an AWS backup vault (i.e. deletes all its restore points) before removing a deployed stack. This makes it possible to remove stacks that contain a backup vault as a resource.
npm install serverless-backup-vault-cleaner --save-dev
Version 1.0.1 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-backup-vault-cleaner | Serverless Framework |
---|---|
v1.0.0 | v1.x, v2.x |
v1.0.1 | v1.x, v2.x, v3.x |
≥ v2.0.0 | v3.x |
Add the following to your serverless.yml
:
plugins:
- serverless-backup-vault-cleaner
custom:
serverless-backup-vault-cleaner:
# Names of backup vaults to remove before a stack is removed
backupVaults:
- vaultName1
- vaultName2
# (optional) Backup vaults to remove before a stack is deployed
backupVaultsToCleanOnDeploy:
- oldBucketName
When removing a Serverless Framework stack, this plugin automatically empties the backup vaults listed under backupVaults
option.
When deploying a Serverless Framework stack, this plugin automatically empties the backup vaults listed under backupVaultsToCleanOnDeploy
option.
Use this when renaming or removing a backup vault (put here the old vault name) to avoid deployment errors when CloudFormation tries to remove the old backup vault.
The plugin requires the following permissions for the role that Serverless runs with:
- backup:DescribeBackupVault
- backup:ListRecoveryPointsByBackupVault
- backup:DeleteRecoveryPoint