CompositeAlarmProps

class aws_cdk.aws_cloudwatch.CompositeAlarmProps(*, alarm_rule, actions_enabled=None, alarm_description=None, composite_alarm_name=None)

Bases: object

Properties for creating a Composite Alarm.

Parameters:
  • alarm_rule (IAlarmRule) – Expression that specifies which other alarms are to be evaluated to determine this composite alarm’s state.

  • actions_enabled (Optional[bool]) – Whether the actions for this alarm are enabled. Default: true

  • alarm_description (Optional[str]) – Description for the alarm. Default: No description

  • composite_alarm_name (Optional[str]) – Name of the alarm. Default: Automatically generated name

ExampleMetadata:

infused

Example:

# alarm1: cloudwatch.Alarm
# alarm2: cloudwatch.Alarm
# alarm3: cloudwatch.Alarm
# alarm4: cloudwatch.Alarm


alarm_rule = cloudwatch.AlarmRule.any_of(
    cloudwatch.AlarmRule.all_of(
        cloudwatch.AlarmRule.any_of(alarm1,
            cloudwatch.AlarmRule.from_alarm(alarm2, cloudwatch.AlarmState.OK), alarm3),
        cloudwatch.AlarmRule.not(cloudwatch.AlarmRule.from_alarm(alarm4, cloudwatch.AlarmState.INSUFFICIENT_DATA))),
    cloudwatch.AlarmRule.from_boolean(False))

cloudwatch.CompositeAlarm(self, "MyAwesomeCompositeAlarm",
    alarm_rule=alarm_rule
)

Attributes

actions_enabled

Whether the actions for this alarm are enabled.

Default:

true

alarm_description

Description for the alarm.

Default:

No description

alarm_rule

Expression that specifies which other alarms are to be evaluated to determine this composite alarm’s state.

composite_alarm_name

Name of the alarm.

Default:

Automatically generated name