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.aps.CfnAnomalyDetector
- All Implemented Interfaces:
IInspectable,IAnomalyDetectorRef,IEnvironmentAware,ITaggableV2,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.120.0 (build 192dc88)",
date="2025-12-05T22:26:29.051Z")
@Stability(Stable)
public class CfnAnomalyDetector
extends CfnResource
implements IInspectable, IAnomalyDetectorRef, ITaggableV2
Anomaly detection uses the Random Cut Forest algorithm for time-series analysis.
The anomaly detector analyzes Amazon Managed Service for Prometheus metrics to identify unusual patterns and behaviors.
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.aps.*;
CfnAnomalyDetector cfnAnomalyDetector = CfnAnomalyDetector.Builder.create(this, "MyCfnAnomalyDetector")
.alias("alias")
.configuration(AnomalyDetectorConfigurationProperty.builder()
.randomCutForest(RandomCutForestConfigurationProperty.builder()
.query("query")
// the properties below are optional
.ignoreNearExpectedFromAbove(IgnoreNearExpectedProperty.builder()
.amount(123)
.ratio(123)
.build())
.ignoreNearExpectedFromBelow(IgnoreNearExpectedProperty.builder()
.amount(123)
.ratio(123)
.build())
.sampleSize(123)
.shingleSize(123)
.build())
.build())
.workspace("workspace")
// the properties below are optional
.evaluationIntervalInSeconds(123)
.labels(List.of(LabelProperty.builder()
.key("key")
.value("value")
.build()))
.missingDataAction(MissingDataActionProperty.builder()
.markAsAnomaly(false)
.skip(false)
.build())
.tags(List.of(CfnTag.builder()
.key("key")
.value("value")
.build()))
.build();
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceThe configuration for the anomaly detection algorithm.static final classA fluent builder forCfnAnomalyDetector.static interfaceConfiguration for threshold settings that determine when values near expected values should be ignored during anomaly detection.static interfaceThe Amazon Managed Service for Prometheus metric labels associated with the anomaly detector.static interfaceSpecifies the action to take when data is missing during anomaly detection evaluation.static interfaceConfiguration for the Random Cut Forest algorithm used for anomaly detection in time-series data.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.amazon.awscdk.interfaces.aps.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$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.ITaggableV2
ITaggableV2.Jsii$Default, ITaggableV2.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, CfnAnomalyDetectorProps props) Create a newAWS::APS::AnomalyDetector. -
Method Summary
Modifier and TypeMethodDescriptionstatic StringarnForAnomalyDetector(IAnomalyDetectorRef resource) getAlias()The user-friendly name of the anomaly detector.A reference to a AnomalyDetector resource.The Amazon Resource Name (ARN) of the anomaly detector.Tag Manager which manages the tags for this resource.The algorithm configuration of the anomaly detector.The frequency, in seconds, at which the anomaly detector evaluates metrics.The Amazon Managed Service for Prometheus metric labels associated with the anomaly detector.The action taken when data is missing during evaluation.getTags()The tags applied to the anomaly detector.An Amazon Managed Service for Prometheus workspace is a logical and isolated Prometheus server dedicated to ingesting, storing, and querying your Prometheus-compatible metrics.voidinspect(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.static BooleanChecks whether the given object is a CfnAnomalyDetector.renderProperties(Map<String, Object> props) voidThe user-friendly name of the anomaly detector.voidsetConfiguration(IResolvable value) The algorithm configuration of the anomaly detector.voidThe algorithm configuration of the anomaly detector.voidThe frequency, in seconds, at which the anomaly detector evaluates metrics.voidThe Amazon Managed Service for Prometheus metric labels associated with the anomaly detector.voidsetLabels(IResolvable value) The Amazon Managed Service for Prometheus metric labels associated with the anomaly detector.voidsetMissingDataAction(IResolvable value) The action taken when data is missing during evaluation.voidThe action taken when data is missing during evaluation.voidThe tags applied to the anomaly detector.voidsetWorkspace(String value) An Amazon Managed Service for Prometheus workspace is a logical and isolated Prometheus server dedicated to ingesting, storing, and querying your Prometheus-compatible metrics.Methods inherited from class software.amazon.awscdk.CfnResource
addDeletionOverride, addDependency, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getAtt, getCfnOptions, getCfnResourceType, getEnv, 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.awscdk.interfaces.IEnvironmentAware
getEnvMethods 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, @NotNull CfnAnomalyDetectorProps props) Create a newAWS::APS::AnomalyDetector.- 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. This parameter is required.
-
-
Method Details
-
arnForAnomalyDetector
@Stability(Stable) @NotNull public static String arnForAnomalyDetector(@NotNull IAnomalyDetectorRef resource) - Parameters:
resource- This parameter is required.
-
isCfnAnomalyDetector
Checks whether the given object is a CfnAnomalyDetector.- Parameters:
x- This parameter is required.
-
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
-
getAttrArn
The Amazon Resource Name (ARN) of the anomaly detector. -
getCdkTagManager
Tag Manager which manages the tags for this resource.- Specified by:
getCdkTagManagerin interfaceITaggableV2
-
getCfnProperties
- Overrides:
getCfnPropertiesin classCfnResource
-
getAlias
The user-friendly name of the anomaly detector. -
setAlias
The user-friendly name of the anomaly detector. -
getConfiguration
The algorithm configuration of the anomaly detector.Returns union: either
IResolvableorCfnAnomalyDetector.AnomalyDetectorConfigurationProperty -
setConfiguration
The algorithm configuration of the anomaly detector. -
setConfiguration
@Stability(Stable) public void setConfiguration(@NotNull CfnAnomalyDetector.AnomalyDetectorConfigurationProperty value) The algorithm configuration of the anomaly detector. -
getWorkspace
An Amazon Managed Service for Prometheus workspace is a logical and isolated Prometheus server dedicated to ingesting, storing, and querying your Prometheus-compatible metrics. -
setWorkspace
An Amazon Managed Service for Prometheus workspace is a logical and isolated Prometheus server dedicated to ingesting, storing, and querying your Prometheus-compatible metrics. -
getEvaluationIntervalInSeconds
The frequency, in seconds, at which the anomaly detector evaluates metrics. -
setEvaluationIntervalInSeconds
The frequency, in seconds, at which the anomaly detector evaluates metrics. -
getLabels
The Amazon Managed Service for Prometheus metric labels associated with the anomaly detector.Returns union: either
IResolvableor Listinvalid input: '<'eitherIResolvableorCfnAnomalyDetector.LabelProperty> -
setLabels
The Amazon Managed Service for Prometheus metric labels associated with the anomaly detector. -
setLabels
The Amazon Managed Service for Prometheus metric labels associated with the anomaly detector. -
getMissingDataAction
The action taken when data is missing during evaluation.Returns union: either
IResolvableorCfnAnomalyDetector.MissingDataActionProperty -
setMissingDataAction
The action taken when data is missing during evaluation. -
setMissingDataAction
@Stability(Stable) public void setMissingDataAction(@Nullable CfnAnomalyDetector.MissingDataActionProperty value) The action taken when data is missing during evaluation. -
getTags
The tags applied to the anomaly detector. -
setTags
The tags applied to the anomaly detector.
-