AlarmStatusWidgetProps Struct
Properties for an Alarm Status Widget.
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,
},
}))
Properties
alarmsIAlarmRef[]alarmstyping.List[IAlarmRef]alarmsList<IAlarmRef>AlarmsIAlarmRef[]Alarms*[]IAlarmRefrequired#CloudWatch Alarms to show in widget.
heightoptionalnumberheightoptionalint | floatheightoptionalNumberHeightoptionaldoubleHeightoptional*float64= 3#Height of the widget.
sortByoptionalAlarmStatusWidgetSortBysort_byoptionalAlarmStatusWidgetSortBysortByoptionalAlarmStatusWidgetSortBySortByoptionalAlarmStatusWidgetSortBySortByoptionalAlarmStatusWidgetSortBy#Specifies how to sort the alarms in the widget.
Default: alphabetical order
statesoptionalAlarmState[]statesoptionaltyping.List[AlarmState]statesoptionalList<AlarmState>StatesoptionalAlarmState[]Statesoptional*[]AlarmState#Use this field to filter the list of alarms displayed in the widget to only those alarms currently in the specified states.
Default: all the alarms specified in alarms are displayed.
notes
You can specify one or more alarm states in the value for this field. The alarm states that you can specify are ALARM, INSUFFICIENT_DATA, and OK.
If you omit this field or specify an empty array, all the alarms specified in alarms are displayed.
The title of the widget.
Default: 'Alarm Status'
widthoptionalnumberwidthoptionalint | floatwidthoptionalNumberWidthoptionaldoubleWidthoptional*float64= 6#Width of the widget, in a grid of 24 units wide.