I have a config that lists two different events
functions:
dummy-logger:
handler: handler.logger
events:
- cloudwatchLog:
logGroup: '/aws/lambda/yada-${self:provider.stage}-dummy'
filter: 'REPORT'
- cloudwatchLog:
logGroup: '/aws/lambda/yada-${self:provider.stage}-dummy2'
filter: 'REPORT'
It creates 2 SubscriptionFilter objects
functionnameLogsSubscriptionFilterCloudWatchLog AWS::Logs::SubscriptionFilter
functionnameLogsSubscriptionFilterCloudWatchLog2 AWS::Logs::SubscriptionFilter
but only one Permission object
functionnameLambdaPermissionLogsSubscriptionFilterCloudWatchLog AWS::Lambda::Permission
which only includes the loggroup from the first subscription filter
as such the CFN template fails with
Could not execute the lambda function. Make sure you have given CloudWatch Logs permission to execute your function. (Service: AWSLogs; Status Code: 400; Error Code: InvalidParameterException; Request ID: 0b096e01-87d2-11e9-b52a-59a1410a5e04)
I have confirmed I’m running serverless@1.44.1