fourTheorem / slic-watch

Instant alarms and dashboards for Serverless, SAM, CDK and CloudFormation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Behaviour for custom resource Lambdas differs for alarms and dashboards

eoinsha opened this issue · comments

Describe the bug
When Lambda functions are injected by the serverless framework or other plugins for custom resources, these functions do not appear at the top-level functions block defined by the user in serverless.yml. An example of this is the function created by Serverless Framework when logs: {restApi: true} is enabled. In this case, a function is injected to create an IAM role so API Gateway can push logs to CloudWatch Logs (apiGatewayCloudWatchRole/handler.js).

As part of the resolution to issue #67, these functions are ignored for alarms. For dashboards, the function configuration handling is differently, so dashboard widgets are created for such functions by default. This is an inconsistency.

To Reproduce
In slic-starter (slic-watch branch), build the user-service using sls package

Expected behavior
Consistent behaviour for function-specific configuration in alarms and dashboards and clear behaviour for alarms and widgets relating to these "extra" functions.