# ConditionProperty

The thresholds that set the alert's state.

Specify at least one of WarningThreshold and CriticalThreshold.

- Source: Generated at build time
- Type last changed: v2.277.0 · 13 Nov 2026

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_cloudwatch as cloudwatch } from 'aws-cdk-lib';
const conditionProperty: cloudwatch.CfnAlert.ConditionProperty = {
  comparator: 'comparator',
  criticalThreshold: 123,
  thresholdField: 'thresholdField',
  thresholdMode: 'thresholdMode',
  warningThreshold: 123,
};
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_cloudwatch as cloudwatch

condition_property = cloudwatch.CfnAlert.ConditionProperty(
    comparator="comparator",
    critical_threshold=123,
    threshold_field="thresholdField",
    threshold_mode="thresholdMode",
    warning_threshold=123
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.cloudwatch.*;

ConditionProperty conditionProperty = ConditionProperty.builder()
        .comparator("comparator")
        .criticalThreshold(123)
        .thresholdField("thresholdField")
        .thresholdMode("thresholdMode")
        .warningThreshold(123)
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.CloudWatch;

var conditionProperty = new ConditionProperty {
    Comparator = "comparator",
    CriticalThreshold = 123,
    ThresholdField = "thresholdField",
    ThresholdMode = "thresholdMode",
    WarningThreshold = 123
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

conditionProperty := &ConditionProperty{
	Comparator: jsii.String("comparator"),
	CriticalThreshold: jsii.Number(123),
	ThresholdField: jsii.String("thresholdField"),
	ThresholdMode: jsii.String("thresholdMode"),
	WarningThreshold: jsii.Number(123),
}
```

## Properties

- `comparator`: string — The comparison operator.

  Valid values: GT, GTE, LT, LTE (greater than, greater than or equal to, less than, less than or equal to).

- `criticalThreshold`: number — The value at which the alert enters the CRITICAL state.

- `thresholdField`: string — The result field to compare against the threshold.

  Required when ThresholdMode is FIELD_VALUE.

- `thresholdMode`: string — How the threshold is applied.

  COUNT_OF_RESULTS compares the number of rows the query returns. FIELD_VALUE compares the value of ThresholdField in each result row; each row is tracked separately.

- `warningThreshold`: number — The value at which the alert enters the WARNING state.
