Is there a configuration setting to allow log groups auto resourced by the Framework to be retained when a Lambda Function is removed?
I’m working in an AWS account where Log Groups are unable to be deleted for compliance reasons. Currently when I remove a function from the Serverless Stack the sls deploy
command is unsuccessful due to the Log Group not be able to be deleted by the CloudFormation Role.
An error occurred: SomeLogGroup - User: arn:aws:sts::000000000:assumed-role/deployer-role is not authorized to perform: logs:DeleteLogGroup on resource: arn:aws:logs:eu-west-2:000000000:log-group:/aws/lambda/some-log-group:log-stream: with an explicit deny (Service: CloudWatchLogs, Status Code: 400, Request ID: HJKHUDH-78677-HJKHJK, Extended Request ID: null).
It would be great if there was a retainLogGroups
configuration parameter that would mean log groups are removed from the stack but not destroyed when a function is removed.