Class CfnAnomalyDetector
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.CfnElement
software.amazon.awscdk.CfnRefElement
software.amazon.awscdk.CfnResource
software.amazon.awscdk.services.cloudwatch.CfnAnomalyDetector
- All Implemented Interfaces:
IInspectable,IAnomalyDetectorRef,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.113.0 (build fc68b25)",
date="2025-10-14T12:28:07.066Z")
@Stability(Stable)
public class CfnAnomalyDetector
extends CfnResource
implements IInspectable, IAnomalyDetectorRef
The
AWS::CloudWatch::AnomalyDetector type specifies an anomaly detection band for a certain metric and statistic.
The band represents the expected "normal" range for the metric values. Anomaly detection bands can be used for visualization of a metric's expected values, and for alarms.
For more information see Using CloudWatch anomaly detection. .
Example:
// 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.*;
CfnAnomalyDetector cfnAnomalyDetector = CfnAnomalyDetector.Builder.create(this, "MyCfnAnomalyDetector")
.configuration(ConfigurationProperty.builder()
.excludedTimeRanges(List.of(RangeProperty.builder()
.endTime("endTime")
.startTime("startTime")
.build()))
.metricTimeZone("metricTimeZone")
.build())
.dimensions(List.of(DimensionProperty.builder()
.name("name")
.value("value")
.build()))
.metricCharacteristics(MetricCharacteristicsProperty.builder()
.periodicSpikes(false)
.build())
.metricMathAnomalyDetector(MetricMathAnomalyDetectorProperty.builder()
.metricDataQueries(List.of(MetricDataQueryProperty.builder()
.id("id")
// the properties below are optional
.accountId("accountId")
.expression("expression")
.label("label")
.metricStat(MetricStatProperty.builder()
.metric(MetricProperty.builder()
.metricName("metricName")
.namespace("namespace")
// the properties below are optional
.dimensions(List.of(DimensionProperty.builder()
.name("name")
.value("value")
.build()))
.build())
.period(123)
.stat("stat")
// the properties below are optional
.unit("unit")
.build())
.period(123)
.returnData(false)
.build()))
.build())
.metricName("metricName")
.namespace("namespace")
.singleMetricAnomalyDetector(SingleMetricAnomalyDetectorProperty.builder()
.accountId("accountId")
.dimensions(List.of(DimensionProperty.builder()
.name("name")
.value("value")
.build()))
.metricName("metricName")
.namespace("namespace")
.stat("stat")
.build())
.stat("stat")
.build();
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA fluent builder forCfnAnomalyDetector.static interfaceSpecifies details about how the anomaly detection model is to be trained, including time ranges to exclude when training and updating the model.static interfaceA dimension is a name/value pair that is part of the identity of a metric.static interfaceThis object includes parameters that you can use to provide information to CloudWatch to help it build more accurate anomaly detection models.static interfaceThis structure is used in bothGetMetricDataandPutMetricAlarm.static interfaceIndicates the CloudWatch math expression that provides the time series the anomaly detector uses as input.static interfaceRepresents a specific metric.static interfaceThis structure defines the metric to be returned, along with the statistics, period, and units.static interfaceEachRangespecifies one range of days or times to exclude from use for training or updating an anomaly detection model.static interfaceDesignates the CloudWatch metric and statistic that provides the time series the anomaly detector uses as input.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.amazon.awscdk.services.cloudwatch.IAnomalyDetectorRef
IAnomalyDetectorRef.Jsii$Default, IAnomalyDetectorRef.Jsii$ProxyNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe CloudFormation resource type name for this resource class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCfnAnomalyDetector(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnAnomalyDetector(software.amazon.jsii.JsiiObjectRef objRef) CfnAnomalyDetector(software.constructs.Construct scope, String id) CfnAnomalyDetector(software.constructs.Construct scope, String id, CfnAnomalyDetectorProps props) -
Method Summary
Modifier and TypeMethodDescriptionA reference to a AnomalyDetector resource.Specifies details about how the anomaly detection model is to be trained, including time ranges to exclude when training and updating the model.The dimensions of the metric associated with the anomaly detection band.Use this object to include parameters to provide information about your metric to CloudWatch to help it build more accurate anomaly detection models.The CloudWatch metric math expression for this anomaly detector.The name of the metric associated with the anomaly detection band.The namespace of the metric associated with the anomaly detection band.The CloudWatch metric and statistic for this anomaly detector.getStat()The statistic of the metric associated with the anomaly detection band.voidinspect(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties(Map<String, Object> props) voidsetConfiguration(IResolvable value) Specifies details about how the anomaly detection model is to be trained, including time ranges to exclude when training and updating the model.voidSpecifies details about how the anomaly detection model is to be trained, including time ranges to exclude when training and updating the model.voidsetDimensions(List<Object> value) The dimensions of the metric associated with the anomaly detection band.voidsetDimensions(IResolvable value) The dimensions of the metric associated with the anomaly detection band.voidUse this object to include parameters to provide information about your metric to CloudWatch to help it build more accurate anomaly detection models.voidUse this object to include parameters to provide information about your metric to CloudWatch to help it build more accurate anomaly detection models.voidThe CloudWatch metric math expression for this anomaly detector.voidThe CloudWatch metric math expression for this anomaly detector.voidsetMetricName(String value) The name of the metric associated with the anomaly detection band.voidsetNamespace(String value) The namespace of the metric associated with the anomaly detection band.voidThe CloudWatch metric and statistic for this anomaly detector.voidThe CloudWatch metric and statistic for this anomaly detector.voidThe statistic of the metric associated with the anomaly detection band.Methods inherited from class software.amazon.awscdk.CfnResource
addDeletionOverride, addDependency, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, obtainDependencies, obtainResourceDependencies, removeDependency, replaceDependency, shouldSynthesize, toString, validatePropertiesMethods inherited from class software.amazon.awscdk.CfnRefElement
getRefMethods inherited from class software.amazon.awscdk.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdMethods inherited from class software.constructs.Construct
getNode, isConstructMethods 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.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
-
-
Constructor Details
-
CfnAnomalyDetector
protected CfnAnomalyDetector(software.amazon.jsii.JsiiObjectRef objRef) -
CfnAnomalyDetector
protected CfnAnomalyDetector(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnAnomalyDetector
@Stability(Stable) public CfnAnomalyDetector(@NotNull software.constructs.Construct scope, @NotNull String id, @Nullable CfnAnomalyDetectorProps props) - Parameters:
scope- Scope in which this resource is defined. This parameter is required.id- Construct identifier for this resource (unique in its scope). This parameter is required.props- Resource properties.
-
CfnAnomalyDetector
@Stability(Stable) public CfnAnomalyDetector(@NotNull software.constructs.Construct scope, @NotNull String id) - Parameters:
scope- Scope in which this resource is defined. This parameter is required.id- Construct identifier for this resource (unique in its scope). This parameter is required.
-
-
Method Details
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspectin interfaceIInspectable- Parameters:
inspector- tree inspector to collect and process attributes. This parameter is required.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderPropertiesin classCfnResource- Parameters:
props- This parameter is required.
-
getAnomalyDetectorRef
A reference to a AnomalyDetector resource.- Specified by:
getAnomalyDetectorRefin interfaceIAnomalyDetectorRef
-
getAttrId
-
getCfnProperties
- Overrides:
getCfnPropertiesin classCfnResource
-
getConfiguration
Specifies details about how the anomaly detection model is to be trained, including time ranges to exclude when training and updating the model. -
setConfiguration
Specifies details about how the anomaly detection model is to be trained, including time ranges to exclude when training and updating the model. -
setConfiguration
@Stability(Stable) public void setConfiguration(@Nullable CfnAnomalyDetector.ConfigurationProperty value) Specifies details about how the anomaly detection model is to be trained, including time ranges to exclude when training and updating the model. -
getDimensions
The dimensions of the metric associated with the anomaly detection band. -
setDimensions
The dimensions of the metric associated with the anomaly detection band. -
setDimensions
The dimensions of the metric associated with the anomaly detection band. -
getMetricCharacteristics
Use this object to include parameters to provide information about your metric to CloudWatch to help it build more accurate anomaly detection models. -
setMetricCharacteristics
Use this object to include parameters to provide information about your metric to CloudWatch to help it build more accurate anomaly detection models. -
setMetricCharacteristics
@Stability(Stable) public void setMetricCharacteristics(@Nullable CfnAnomalyDetector.MetricCharacteristicsProperty value) Use this object to include parameters to provide information about your metric to CloudWatch to help it build more accurate anomaly detection models. -
getMetricMathAnomalyDetector
The CloudWatch metric math expression for this anomaly detector. -
setMetricMathAnomalyDetector
The CloudWatch metric math expression for this anomaly detector. -
setMetricMathAnomalyDetector
@Stability(Stable) public void setMetricMathAnomalyDetector(@Nullable CfnAnomalyDetector.MetricMathAnomalyDetectorProperty value) The CloudWatch metric math expression for this anomaly detector. -
getMetricName
The name of the metric associated with the anomaly detection band. -
setMetricName
The name of the metric associated with the anomaly detection band. -
getNamespace
The namespace of the metric associated with the anomaly detection band. -
setNamespace
The namespace of the metric associated with the anomaly detection band. -
getSingleMetricAnomalyDetector
The CloudWatch metric and statistic for this anomaly detector. -
setSingleMetricAnomalyDetector
The CloudWatch metric and statistic for this anomaly detector. -
setSingleMetricAnomalyDetector
@Stability(Stable) public void setSingleMetricAnomalyDetector(@Nullable CfnAnomalyDetector.SingleMetricAnomalyDetectorProperty value) The CloudWatch metric and statistic for this anomaly detector. -
getStat
The statistic of the metric associated with the anomaly detection band. -
setStat
The statistic of the metric associated with the anomaly detection band.
-