class AlarmWidget
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.CloudWatch.AlarmWidget |
Java | software.amazon.awscdk.services.cloudwatch.AlarmWidget |
Python | aws_cdk.aws_cloudwatch.AlarmWidget |
TypeScript (source) | @aws-cdk/aws-cloudwatch » AlarmWidget |
Implements
IWidget
Extends
Concrete
Display the metric associated with an alarm, including the alarm line.
Example
declare const dashboard: cloudwatch.Dashboard;
declare const errorAlarm: cloudwatch.Alarm;
dashboard.addWidgets(new cloudwatch.AlarmWidget({
title: "Errors",
alarm: errorAlarm,
}));
Initializer
new AlarmWidget(props: AlarmWidgetProps)
Parameters
- props
AlarmWidget 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. |
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.
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.

.NET
Java
Python
TypeScript (