Skip to content
v2.274.0

AlarmStatusWidget Class ​

A dashboard widget that displays alarms in a grid view.

Example ​

ts
declare const dashboard: cloudwatch.Dashboard;
declare const errorAlarm: cloudwatch.Alarm;

dashboard.addWidgets(
  new cloudwatch.AlarmStatusWidget({
    alarms: [errorAlarm],
  })
);
python
# dashboard: cloudwatch.Dashboard
# error_alarm: cloudwatch.Alarm


dashboard.add_widgets(
    cloudwatch.AlarmStatusWidget(
        alarms=[error_alarm]
    ))
java
Dashboard dashboard;
Alarm errorAlarm;


dashboard.addWidgets(
AlarmStatusWidget.Builder.create()
        .alarms(List.of(errorAlarm))
        .build());
csharp
// Install: dotnet add package Amazon.CDK.Lib
Dashboard dashboard;
Alarm errorAlarm;


dashboard.AddWidgets(
new AlarmStatusWidget(new AlarmStatusWidgetProps {
    Alarms = new [] { errorAlarm }
}));
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
var dashboard Dashboard
var errorAlarm Alarm


dashboard.AddWidgets(
cloudwatch.NewAlarmStatusWidget(&AlarmStatusWidgetProps{
	Alarms: []IAlarmRef{
		errorAlarm,
	},
}))

Initializer ​

ts
new AlarmStatusWidget(props: AlarmStatusWidgetProps)
python
AlarmStatusWidget(props: AlarmStatusWidgetProps)
java
new AlarmStatusWidget(AlarmStatusWidgetProps props)
csharp
new AlarmStatusWidget(AlarmStatusWidgetProps props)
go
NewAlarmStatusWidget(Props AlarmStatusWidgetProps)

Properties ​

heightnumberheightint | floatheightNumberHeightdoubleHeight*float64required#
The amount of vertical grid units the widget will take up.
warningsmay be undefinedstring[]warningsmay be undefinedtyping.List[str]warningsmay be undefinedList<String>Warningsmay be undefinedstring[]Warningsmay be undefined*[]*string#
Any warnings that are produced as a result of putting together this widget.
warningsV2may be undefined{ [key: string]: string }warnings_v2may be undefinedtyping.Mapping[str, str]warningsV2may be undefinedMap<String, String>WarningsV2may be undefinedIDictionary<string, string>WarningsV2may be undefined*map[string]*string#
Any warnings that are produced as a result of putting together this widget.
widthnumberwidthint | floatwidthNumberWidthdoubleWidth*float64required#
The amount of horizontal grid units the widget will take up.

Methods ​

position(x: number, y: number): voiddef position(self, x: int | float, y: int | float) -> Nonepublic void position(Number x, Number y)public void Position(double x, double y)func Position(X *float64, Y *float64)#
Place the widget at a given position.
toJson(): any[]def to_json(self, ) -> typing.List[Any]public List<Object> toJson()public object[] ToJson()func ToJson() *[]interface{}#
Return the widget JSON for use in the dashboard.