class CustomWidget
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.CloudWatch.CustomWidget |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awscloudwatch#CustomWidget |
Java | software.amazon.awscdk.services.cloudwatch.CustomWidget |
Python | aws_cdk.aws_cloudwatch.CustomWidget |
TypeScript (source) | aws-cdk-lib » aws_cloudwatch » CustomWidget |
Implements
IWidget
Extends
Concrete
A CustomWidget shows the result of a AWS lambda function.
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',
}));
Initializer
new CustomWidget(props: CustomWidgetProps)
Parameters
- props
Custom
Widget Props
Properties
Name | Type | Description |
---|---|---|
height | number | The amount of vertical grid units the widget will take up. |
width | number | The amount of horizontal grid units the widget will take up. |
warnings? | string[] | Any warnings that are produced as a result of putting together this widget. |
warnings | { [string]: string } | Any warnings that are produced as a result of putting together this widget. |
height
Type:
number
The amount of vertical grid units the widget will take up.
width
Type:
number
The amount of horizontal grid units the widget will take up.
warnings?
Type:
string[]
(optional)
Any warnings that are produced as a result of putting together this widget.
warningsV2?
Type:
{ [string]: string }
(optional)
Any warnings that are produced as a result of putting together this widget.
Methods
Name | Description |
---|---|
position(x, y) | Place the widget at a given position. |
to | Return the widget JSON for use in the dashboard. |
position(x, y)
public position(x: number, y: number): void
Parameters
- x
number
- y
number
Place the widget at a given position.
toJson()
public toJson(): any[]
Returns
any[]
Return the widget JSON for use in the dashboard.