(aws-cloudwatch): support Custom Widgets #17579
Labels
@aws-cdk/aws-cloudwatch
Related to Amazon CloudWatch
effort/medium
Medium work item – several days of effort
feature-request
A feature should be added or improved.
p2
Description
Support
CustomWidget
as a type of CloudWatch widget that can be inserted inDashboard
's.Most of the logic for customizing a
CustomWidget
has to be in the lambda code, but I think this L2 would still provide some value by automatically generating the dashboard JSON for you - we currently do that by hand in our implementation of a custom widget as seen here: https://github.com/cdklabs/construct-hub/blob/4e63b8a78c505aafdd035c7ed5cc0c382921d64d/src/backend/inventory/package-versions-table-widget.ts#L44Use Case
I think there could be some potential to build construct libraries that provide different useful custom widgets. Custom widgets seem decently flexible since they can contain HTML, SVG's, and buttons that invoke other lambda's.
Proposed Solution
The
CustomWidget
would be a type of CloudWatch widget that extendsConcreteWidget
. It could be configured with a required Lambda parameter (which when invoked should return the the content to display in the dashboard), as well as parameters for when the widget should automatically update.Other information
Docs reference: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/add_custom_widget_dashboard.html
Full custom widget definition (provided since the full definition syntax / options still need to be added to the AWS docs):
Acknowledge
The text was updated successfully, but these errors were encountered: