# AtLeastThreshold

Threshold configuration for the AT_LEAST composite alarm rule expression.

Use `AtLeastThreshold.count()` for an absolute number or
`AtLeastThreshold.percentage()` for a percentage-based threshold.

- Source: [`aws-cloudwatch/lib/alarm-rule.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-cloudwatch/lib/alarm-rule.ts#L73)
- Type last changed: v2.265.0 · 13 Aug 2026

## Example

```ts
declare const alarm1: cloudwatch.Alarm;
declare const alarm2: cloudwatch.Alarm;
declare const alarm3: cloudwatch.Alarm;
declare const alarm4: cloudwatch.Alarm;

const alarmRule = cloudwatch.AlarmRule.anyOf(
  cloudwatch.AlarmRule.allOf(
    cloudwatch.AlarmRule.anyOf(
      alarm1,
      cloudwatch.AlarmRule.fromAlarm(alarm2, cloudwatch.AlarmState.OK),
      alarm3,
    ),
    cloudwatch.AlarmRule.not(cloudwatch.AlarmRule.fromAlarm(alarm4, cloudwatch.AlarmState.INSUFFICIENT_DATA)),
    // AT_LEAST with count: at least 2 of these alarms must be in ALARM state
    cloudwatch.AlarmRule.atLeast(cloudwatch.AlarmState.ALARM, {
      operands: [alarm1, alarm2, alarm3],
      threshold: cloudwatch.AtLeastThreshold.count(2),
    }),
    // AT_LEAST with percentage and NOT: at least 60% must NOT be in OK state
    cloudwatch.AlarmRule.atLeastNot(cloudwatch.AlarmState.OK, {
      operands: [alarm1, alarm2, alarm3],
      threshold: cloudwatch.AtLeastThreshold.percentage(60),
    }),
  ),
  cloudwatch.AlarmRule.fromBoolean(false),
);

new cloudwatch.CompositeAlarm(this, 'MyAwesomeCompositeAlarm', {
  alarmRule,
});
```

## Initializer

```ts
new AtLeastThreshold()
```

## Methods

- `count(count: number): AtLeastThreshold // chainable` (static) — Creates a count-based threshold for the AT_LEAST expression.

  The count must be a positive integer between 1 and the number of operands.

  **Parameters**

  - `count` — the minimum number of alarms that must be in the specified state.

- `percentage(percentage: number): AtLeastThreshold // chainable` (static) — Creates a percentage-based threshold for the AT_LEAST expression.

  The percentage must be an integer between 1 and 100.

  **Parameters**

  - `percentage` — the minimum percentage of alarms that must be in the specified state.
