ConditionProperty Struct Added in v2.277.0
The thresholds that set the alert's state.
Specify at least one of WarningThreshold and CriticalThreshold.
Example
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
# 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
// 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();
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
};
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
comparatoroptionalstringcomparatoroptionalstrcomparatoroptionalStringComparatoroptionalstringComparatoroptional*string#The comparison operator.
Valid values: GT, GTE, LT, LTE (greater than, greater than or equal to, less than, less than or equal to).
criticalThresholdoptionalnumbercritical_thresholdoptionalint | floatcriticalThresholdoptionalNumberCriticalThresholdoptionaldoubleCriticalThresholdoptional*float64#The value at which the alert enters the CRITICAL state.
thresholdFieldoptionalstringthreshold_fieldoptionalstrthresholdFieldoptionalStringThresholdFieldoptionalstringThresholdFieldoptional*string#The result field to compare against the threshold.
Required when ThresholdMode is FIELD_VALUE.
thresholdModeoptionalstringthreshold_modeoptionalstrthresholdModeoptionalStringThresholdModeoptionalstringThresholdModeoptional*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.
warningThresholdoptionalnumberwarning_thresholdoptionalint | floatwarningThresholdoptionalNumberWarningThresholdoptionaldoubleWarningThresholdoptional*float64#The value at which the alert enters the WARNING state.