When using cloudwatchLog
event, the deployment will fail with an error that a resource limit exceeded if you replace the logGroup
name of one function with the logGroup
name of another function in your serverless.yml
file and run serverless deploy
This is caused by the fact that CloudFormation tries to attach the new subscription filter before detaching the old one. CloudWatch Logs only support one subscription fitlter per log group as you can read in the documentation about CloudWatch Logs Limits.
We should fix it in upcoming release.
cc @pmuens
Correct!
@horike37 Thanks for opening this one so that we don't forget about it 馃憤
The deployment will fail with same error if change the order of the cloudwatchLog groups list when one lambda has been set multiple cloudwatchLog groups.
I test some of the cases, those tow are succeed:
and those are failed:
I was trying to debug this issue to see if I could help with a first contribution here and on my tests, I realized that this is not a problem on serverless
, but on the CloudFormation itself, I confirmed at after trying to submit a dummy stack adding a log group and a subscription filter, and then after I just changed the key of the subscription filter for something else, the result is the same: CF tries to add it the new one before deleting the existent, therefore everything fails.
Most helpful comment
Correct!
@horike37 Thanks for opening this one so that we don't forget about it 馃憤