Set a deletion policy on your serverless service log groups
$ npm install --save-dev serverless-loggroup-deletion-policy
Add the plugin to your serverless config:
plugins:
- serverless-loggroup-deletion-policy
- ...any other plugins
Then configure the plugin as follows:
custom:
logGroupDeletionPolicy:
keepLambdaLogs: true # or false
This plugin is based off of xoeye/serverless-log-keeper. Due to the number of changes that were required for this plugin to work as I needed, it would be closer to a rewrite than a PR. Therefore, I decided to fork it. The original work was very useful in getting this plugin up and running.
See the LICENSE file for license rights and limitations (MIT).