CustomWidgetProps Struct
The properties for a CustomWidget.
Example
ts
declare const dashboard: cloudwatch.Dashboard;
// Import or create a lambda function
const fn = lambda.Function.fromFunctionArn(
dashboard,
'Function',
'arn:aws:lambda:us-east-1:123456789012:function:MyFn',
);
dashboard.addWidgets(new cloudwatch.CustomWidget({
functionArn: fn.functionArn,
title: 'My lambda baked widget',
}));
Properties
The Arn of the AWS Lambda function that returns HTML or JSON that will be displayed in the widget.
heightoptionalnumberheightoptionalint | floatheightoptionalNumberHeightoptionaldoubleHeightoptional*float64#Height of the widget.
Default: 6 for Alarm and Graph widgets. 3 for single value widgets where most recent value of a metric is displayed.
paramsoptionalanyparamsoptionalAnyparamsoptionalObjectParamsoptionalobjectParamsoptionalinterface{}#Parameters passed to the lambda function.
Default: no parameters are passed to the lambda function
The title of the widget.
updateOnRefreshoptionalbooleanupdate_on_refreshoptionalboolupdateOnRefreshoptionalBooleanUpdateOnRefreshoptionalboolUpdateOnRefreshoptional*bool= true#Update the widget on refresh.
updateOnResizeoptionalbooleanupdate_on_resizeoptionalboolupdateOnResizeoptionalBooleanUpdateOnResizeoptionalboolUpdateOnResizeoptional*bool= true#Update the widget on resize.
updateOnTimeRangeChangeoptionalbooleanupdate_on_time_range_changeoptionalboolupdateOnTimeRangeChangeoptionalBooleanUpdateOnTimeRangeChangeoptionalboolUpdateOnTimeRangeChangeoptional*bool= true#Update the widget on time range change.
widthoptionalnumberwidthoptionalint | floatwidthoptionalNumberWidthoptionaldoubleWidthoptional*float64= 6#Width of the widget, in a grid of 24 units wide.