Class CfnAnomalyDetector

java.lang.Object
software.amazon.jsii.JsiiObject
All Implemented Interfaces:
IConstruct, IDependable, IInspectable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:36.805Z") @Stability(Stable) public class CfnAnomalyDetector extends CfnResource implements IInspectable
A CloudFormation AWS::CloudWatch::AnomalyDetector.

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.

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()))
         .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()
                 .dimensions(List.of(DimensionProperty.builder()
                         .name("name")
                         .value("value")
                         .build()))
                 .metricName("metricName")
                 .namespace("namespace")
                 .stat("stat")
                 .build())
         .stat("stat")
         .build();
 
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String 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 Construct scope, @NotNull String id, @Nullable CfnAnomalyDetectorProps props)
      Create a new AWS::CloudWatch::AnomalyDetector.

      Parameters:
      scope -
      • scope in which this resource is defined.
      This parameter is required.
      id -
      • scoped id of the resource.
      This parameter is required.
      props -
      • resource properties.
    • CfnAnomalyDetector

      @Stability(Stable) public CfnAnomalyDetector(@NotNull Construct scope, @NotNull String id)
      Create a new AWS::CloudWatch::AnomalyDetector.

      Parameters:
      scope -
      • scope in which this resource is defined.
      This parameter is required.
      id -
      • scoped id of the resource.
      This parameter is required.
  • Method Details

    • inspect

      @Stability(Stable) public void inspect(@NotNull TreeInspector inspector)
      Examines the CloudFormation resource and discloses attributes.

      Specified by:
      inspect in interface IInspectable
      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:
      renderProperties in class CfnResource
      Parameters:
      props - This parameter is required.
    • getCfnProperties

      @Stability(Stable) @NotNull protected Map<String,Object> getCfnProperties()
      Overrides:
      getCfnProperties in class CfnResource
    • getConfiguration

      @Stability(Stable) @Nullable public Object getConfiguration()
      Specifies details about how the anomaly detection model is to be trained, including time ranges to exclude when training and updating the model.

      The configuration can also include the time zone to use for the metric.

    • setConfiguration

      @Stability(Stable) public void setConfiguration(@Nullable 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.

      The configuration can also include the time zone to use for the metric.

    • 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.

      The configuration can also include the time zone to use for the metric.

    • getDimensions

      @Stability(Stable) @Nullable public Object getDimensions()
      The dimensions of the metric associated with the anomaly detection band.
    • setDimensions

      @Stability(Stable) public void setDimensions(@Nullable IResolvable value)
      The dimensions of the metric associated with the anomaly detection band.
    • setDimensions

      @Stability(Stable) public void setDimensions(@Nullable List<Object> value)
      The dimensions of the metric associated with the anomaly detection band.
    • getMetricMathAnomalyDetector

      @Stability(Stable) @Nullable public Object getMetricMathAnomalyDetector()
      The CloudWatch metric math expression for this anomaly detector.
    • setMetricMathAnomalyDetector

      @Stability(Stable) public void setMetricMathAnomalyDetector(@Nullable IResolvable value)
      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

      @Stability(Stable) @Nullable public String getMetricName()
      The name of the metric associated with the anomaly detection band.
    • setMetricName

      @Stability(Stable) public void setMetricName(@Nullable String value)
      The name of the metric associated with the anomaly detection band.
    • getNamespace

      @Stability(Stable) @Nullable public String getNamespace()
      The namespace of the metric associated with the anomaly detection band.
    • setNamespace

      @Stability(Stable) public void setNamespace(@Nullable String value)
      The namespace of the metric associated with the anomaly detection band.
    • getSingleMetricAnomalyDetector

      @Stability(Stable) @Nullable public Object getSingleMetricAnomalyDetector()
      The CloudWatch metric and statistic for this anomaly detector.
    • setSingleMetricAnomalyDetector

      @Stability(Stable) public void setSingleMetricAnomalyDetector(@Nullable IResolvable value)
      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

      @Stability(Stable) @Nullable public String getStat()
      The statistic of the metric associated with the anomaly detection band.
    • setStat

      @Stability(Stable) public void setStat(@Nullable String value)
      The statistic of the metric associated with the anomaly detection band.