interface CustomWidgetProps
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.CloudWatch.CustomWidgetProps |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awscloudwatch#CustomWidgetProps |
![]() | software.amazon.awscdk.services.cloudwatch.CustomWidgetProps |
![]() | aws_cdk.aws_cloudwatch.CustomWidgetProps |
![]() | aws-cdk-lib » aws_cloudwatch » CustomWidgetProps |
The properties for a CustomWidget.
Example
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
Name | Type | Description |
---|---|---|
function | string | The Arn of the AWS Lambda function that returns HTML or JSON that will be displayed in the widget. |
title | string | The title of the widget. |
height? | number | Height of the widget. |
params? | any | Parameters passed to the lambda function. |
update | boolean | Update the widget on refresh. |
update | boolean | Update the widget on resize. |
update | boolean | Update the widget on time range change. |
width? | number | Width of the widget, in a grid of 24 units wide. |
functionArn
Type:
string
The Arn of the AWS Lambda function that returns HTML or JSON that will be displayed in the widget.
title
Type:
string
The title of the widget.
height?
Type:
number
(optional, default: 6 for Alarm and Graph widgets.
3 for single value widgets where most recent value of a metric is displayed.)
Height of the widget.
params?
Type:
any
(optional, default: no parameters are passed to the lambda function)
Parameters passed to the lambda function.
updateOnRefresh?
Type:
boolean
(optional, default: true)
Update the widget on refresh.
updateOnResize?
Type:
boolean
(optional, default: true)
Update the widget on resize.
updateOnTimeRangeChange?
Type:
boolean
(optional, default: true)
Update the widget on time range change.
width?
Type:
number
(optional, default: 6)
Width of the widget, in a grid of 24 units wide.