Class AnomalyDetectionAlarm
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.Resource
software.amazon.awscdk.services.cloudwatch.AlarmBase
software.amazon.awscdk.services.cloudwatch.Alarm
software.amazon.awscdk.services.cloudwatch.AnomalyDetectionAlarm
- All Implemented Interfaces:
IEnvironmentAware,IResource,IAlarm,IAlarmRule,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.119.0 (build 1634eac)",
date="2025-11-13T16:10:00.769Z")
@Stability(Stable)
public class AnomalyDetectionAlarm
extends Alarm
CloudWatch Alarm that uses anomaly detection to trigger alarms.
This alarm type is specifically designed for use with anomaly detection operators like LESS_THAN_LOWER_OR_GREATER_THAN_UPPER_THRESHOLD.
Example:
// Create a metric
Metric metric = Metric.Builder.create()
.namespace("AWS/EC2")
.metricName("CPUUtilization")
.statistic("Average")
.period(Duration.hours(1))
.build();
// Create an anomaly detection alarm
AnomalyDetectionAlarm alarm = AnomalyDetectionAlarm.Builder.create(this, "AnomalyAlarm")
.metric(metric)
.evaluationPeriods(1)
// Number of standard deviations for the band (default: 2)
.stdDevs(2)
// Alarm outside on either side of the band, or just below or above it (default: outside)
.comparisonOperator(ComparisonOperator.LESS_THAN_LOWER_OR_GREATER_THAN_UPPER_THRESHOLD)
.alarmDescription("Alarm when metric is outside the expected band")
.build();
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.amazon.awscdk.services.cloudwatch.IAlarm
IAlarm.Jsii$DefaultNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.IResource
IResource.Jsii$Default -
Field Summary
FieldsFields inherited from class software.amazon.awscdk.services.cloudwatch.Alarm
ANOMALY_DETECTION_NO_THRESHOLD -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAnomalyDetectionAlarm(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedAnomalyDetectionAlarm(software.amazon.jsii.JsiiObjectRef objRef) AnomalyDetectionAlarm(software.constructs.Construct scope, String id, AnomalyDetectionAlarmProps props) -
Method Summary
Methods inherited from class software.amazon.awscdk.services.cloudwatch.Alarm
addAlarmAction, fromAlarmArn, fromAlarmName, getAlarmArn, getAlarmName, getMetric, toAnnotationMethods inherited from class software.amazon.awscdk.services.cloudwatch.AlarmBase
addInsufficientDataAction, addOkAction, getAlarmActionArns, getInsufficientDataActionArns, getOkActionArns, renderAlarmRule, setAlarmActionArns, setInsufficientDataActionArns, setOkActionArnsMethods inherited from class software.amazon.awscdk.Resource
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isOwnedResource, isResourceMethods inherited from class software.constructs.Construct
getNode, isConstruct, toStringMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.constructs.IConstruct
getNodeMethods inherited from interface software.amazon.awscdk.interfaces.IEnvironmentAware
getEnvMethods inherited from interface software.amazon.awscdk.IResource
applyRemovalPolicy, getStackMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
PROPERTY_INJECTION_ID
Uniquely identifies this class.
-
-
Constructor Details
-
AnomalyDetectionAlarm
protected AnomalyDetectionAlarm(software.amazon.jsii.JsiiObjectRef objRef) -
AnomalyDetectionAlarm
protected AnomalyDetectionAlarm(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
AnomalyDetectionAlarm
@Stability(Stable) public AnomalyDetectionAlarm(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull AnomalyDetectionAlarmProps props) - Parameters:
scope- This parameter is required.id- This parameter is required.props- This parameter is required.
-