Skip to content
v2.277.0

TelemetryRuleProperty Struct Added in v2.277.0 ​

A rule that queries telemetry, evaluates the result against a condition, and sets how missing data is handled.

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 telemetryRuleProperty: cloudwatch.CfnAlert.TelemetryRuleProperty = {
  condition: {
    comparator: 'comparator',
    criticalThreshold: 123,
    thresholdField: 'thresholdField',
    thresholdMode: 'thresholdMode',
    warningThreshold: 123,
  },
  evaluation: {
    intervalSeconds: 123,

    // the properties below are optional
    pendingDurationSeconds: 123,
    recoveryDurationSeconds: 123,
  },
  query: {
    expression: 'expression',
    language: 'language',
  },

  // the properties below are optional
  noData: {
    treatAs: 'treatAs',
  },
};
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

telemetry_rule_property = cloudwatch.CfnAlert.TelemetryRuleProperty(
    condition=cloudwatch.CfnAlert.ConditionProperty(
        comparator="comparator",
        critical_threshold=123,
        threshold_field="thresholdField",
        threshold_mode="thresholdMode",
        warning_threshold=123
    ),
    evaluation=cloudwatch.CfnAlert.EvaluationProperty(
        interval_seconds=123,

        # the properties below are optional
        pending_duration_seconds=123,
        recovery_duration_seconds=123
    ),
    query=cloudwatch.CfnAlert.QueryProperty(
        expression="expression",
        language="language"
    ),

    # the properties below are optional
    no_data=cloudwatch.CfnAlert.NoDataProperty(
        treat_as="treatAs"
    )
)
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.*;

TelemetryRuleProperty telemetryRuleProperty = TelemetryRuleProperty.builder()
        .condition(ConditionProperty.builder()
                .comparator("comparator")
                .criticalThreshold(123)
                .thresholdField("thresholdField")
                .thresholdMode("thresholdMode")
                .warningThreshold(123)
                .build())
        .evaluation(EvaluationProperty.builder()
                .intervalSeconds(123)

                // the properties below are optional
                .pendingDurationSeconds(123)
                .recoveryDurationSeconds(123)
                .build())
        .query(QueryProperty.builder()
                .expression("expression")
                .language("language")
                .build())

        // the properties below are optional
        .noData(NoDataProperty.builder()
                .treatAs("treatAs")
                .build())
        .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 telemetryRuleProperty = new TelemetryRuleProperty {
    Condition = new ConditionProperty {
        Comparator = "comparator",
        CriticalThreshold = 123,
        ThresholdField = "thresholdField",
        ThresholdMode = "thresholdMode",
        WarningThreshold = 123
    },
    Evaluation = new EvaluationProperty {
        IntervalSeconds = 123,

        // the properties below are optional
        PendingDurationSeconds = 123,
        RecoveryDurationSeconds = 123
    },
    Query = new QueryProperty {
        Expression = "expression",
        Language = "language"
    },

    // the properties below are optional
    NoData = new NoDataProperty {
        TreatAs = "treatAs"
    }
};
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"

telemetryRuleProperty := &TelemetryRuleProperty{
	Condition: &ConditionProperty{
		Comparator: jsii.String("comparator"),
		CriticalThreshold: jsii.Number(123),
		ThresholdField: jsii.String("thresholdField"),
		ThresholdMode: jsii.String("thresholdMode"),
		WarningThreshold: jsii.Number(123),
	},
	Evaluation: &EvaluationProperty{
		IntervalSeconds: jsii.Number(123),

		// the properties below are optional
		PendingDurationSeconds: jsii.Number(123),
		RecoveryDurationSeconds: jsii.Number(123),
	},
	Query: &QueryProperty{
		Expression: jsii.String("expression"),
		Language: jsii.String("language"),
	},

	// the properties below are optional
	NoData: &NoDataProperty{
		TreatAs: jsii.String("treatAs"),
	},
}

Properties ​

conditionIResolvable | CfnAlert.ConditionPropertyconditiontyping.Union[IResolvable, ConditionProperty]conditionIResolvableConditionIResolvableConditioninterface{}required#
The thresholds that set the alert's state.

Specify at least one of WarningThreshold and CriticalThreshold.

evaluationIResolvable | CfnAlert.EvaluationPropertyevaluationtyping.Union[IResolvable, EvaluationProperty]evaluationIResolvableEvaluationIResolvableEvaluationinterface{}required#
How often the alert is evaluated, and how long a change must last before the state changes.
noDataoptionalIResolvable | CfnAlert.NoDataPropertyno_dataoptionaltyping.Union[IResolvable, NoDataProperty]noDataoptionalIResolvableNoDataoptionalIResolvableNoDataoptionalinterface{}#
How the alert behaves when an evaluation returns no data.

If omitted, the alert reports NODATA.

queryIResolvable | CfnAlert.QueryPropertyquerytyping.Union[IResolvable, QueryProperty]queryIResolvableQueryIResolvableQueryinterface{}required#
The query the alert runs, and the language it is written in.