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.lookoutmetrics.CfnAnomalyDetector
All Implemented Interfaces:
IInspectable, IAnomalyDetectorRef, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.116.0 (build 0eddcff)", date="2025-10-29T11:15:43.240Z") @Stability(Stable) public class CfnAnomalyDetector extends CfnResource implements IInspectable, IAnomalyDetectorRef

End of support notice: On Oct 9, 2025, AWS will end support for Amazon Lookout for Metrics.

After Oct 9, 2025, you will no longer be able to access the Amazon Lookout for Metrics console or Amazon Lookout for Metrics resources. For more information, see Amazon Lookout for Metrics end of support .

The AWS::LookoutMetrics::AnomalyDetector type creates an anomaly detector.

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.lookoutmetrics.*;
 CfnAnomalyDetector cfnAnomalyDetector = CfnAnomalyDetector.Builder.create(this, "MyCfnAnomalyDetector")
         .anomalyDetectorConfig(AnomalyDetectorConfigProperty.builder()
                 .anomalyDetectorFrequency("anomalyDetectorFrequency")
                 .build())
         .metricSetList(List.of(MetricSetProperty.builder()
                 .metricList(List.of(MetricProperty.builder()
                         .aggregationFunction("aggregationFunction")
                         .metricName("metricName")
                         // the properties below are optional
                         .namespace("namespace")
                         .build()))
                 .metricSetName("metricSetName")
                 .metricSource(MetricSourceProperty.builder()
                         .appFlowConfig(AppFlowConfigProperty.builder()
                                 .flowName("flowName")
                                 .roleArn("roleArn")
                                 .build())
                         .cloudwatchConfig(CloudwatchConfigProperty.builder()
                                 .roleArn("roleArn")
                                 .build())
                         .rdsSourceConfig(RDSSourceConfigProperty.builder()
                                 .databaseHost("databaseHost")
                                 .databaseName("databaseName")
                                 .databasePort(123)
                                 .dbInstanceIdentifier("dbInstanceIdentifier")
                                 .roleArn("roleArn")
                                 .secretManagerArn("secretManagerArn")
                                 .tableName("tableName")
                                 .vpcConfiguration(VpcConfigurationProperty.builder()
                                         .securityGroupIdList(List.of("securityGroupIdList"))
                                         .subnetIdList(List.of("subnetIdList"))
                                         .build())
                                 .build())
                         .redshiftSourceConfig(RedshiftSourceConfigProperty.builder()
                                 .clusterIdentifier("clusterIdentifier")
                                 .databaseHost("databaseHost")
                                 .databaseName("databaseName")
                                 .databasePort(123)
                                 .roleArn("roleArn")
                                 .secretManagerArn("secretManagerArn")
                                 .tableName("tableName")
                                 .vpcConfiguration(VpcConfigurationProperty.builder()
                                         .securityGroupIdList(List.of("securityGroupIdList"))
                                         .subnetIdList(List.of("subnetIdList"))
                                         .build())
                                 .build())
                         .s3SourceConfig(S3SourceConfigProperty.builder()
                                 .fileFormatDescriptor(FileFormatDescriptorProperty.builder()
                                         .csvFormatDescriptor(CsvFormatDescriptorProperty.builder()
                                                 .charset("charset")
                                                 .containsHeader(false)
                                                 .delimiter("delimiter")
                                                 .fileCompression("fileCompression")
                                                 .headerList(List.of("headerList"))
                                                 .quoteSymbol("quoteSymbol")
                                                 .build())
                                         .jsonFormatDescriptor(JsonFormatDescriptorProperty.builder()
                                                 .charset("charset")
                                                 .fileCompression("fileCompression")
                                                 .build())
                                         .build())
                                 .roleArn("roleArn")
                                 // the properties below are optional
                                 .historicalDataPathList(List.of("historicalDataPathList"))
                                 .templatedPathList(List.of("templatedPathList"))
                                 .build())
                         .build())
                 // the properties below are optional
                 .dimensionList(List.of("dimensionList"))
                 .metricSetDescription("metricSetDescription")
                 .metricSetFrequency("metricSetFrequency")
                 .offset(123)
                 .timestampColumn(TimestampColumnProperty.builder()
                         .columnFormat("columnFormat")
                         .columnName("columnName")
                         .build())
                 .timezone("timezone")
                 .build()))
         // the properties below are optional
         .anomalyDetectorDescription("anomalyDetectorDescription")
         .anomalyDetectorName("anomalyDetectorName")
         .kmsKeyArn("kmsKeyArn")
         .build();
 

See Also:
  • 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 software.constructs.Construct scope, @NotNull String id, @NotNull 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. 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.
    • getAnomalyDetectorRef

      @Stability(Stable) @NotNull public AnomalyDetectorReference getAnomalyDetectorRef()
      A reference to a AnomalyDetector resource.
      Specified by:
      getAnomalyDetectorRef in interface IAnomalyDetectorRef
    • getAttrArn

      @Stability(Stable) @NotNull public String getAttrArn()
      The Amazon Resource Name (ARN) of the detector.

      For example, arn:aws:lookoutmetrics:us-east-2:123456789012:AnomalyDetector:my-detector

    • getCfnProperties

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

      @Stability(Stable) @NotNull public Object getAnomalyDetectorConfig()
      Contains information about the configuration of the anomaly detector.

      Returns union: either IResolvable or CfnAnomalyDetector.AnomalyDetectorConfigProperty

    • setAnomalyDetectorConfig

      @Stability(Stable) public void setAnomalyDetectorConfig(@NotNull IResolvable value)
      Contains information about the configuration of the anomaly detector.
    • setAnomalyDetectorConfig

      @Stability(Stable) public void setAnomalyDetectorConfig(@NotNull CfnAnomalyDetector.AnomalyDetectorConfigProperty value)
      Contains information about the configuration of the anomaly detector.
    • getMetricSetList

      @Stability(Stable) @NotNull public Object getMetricSetList()
      The detector's dataset.

      Returns union: either IResolvable or Listinvalid input: '<'either IResolvable or CfnAnomalyDetector.MetricSetProperty>

    • setMetricSetList

      @Stability(Stable) public void setMetricSetList(@NotNull IResolvable value)
      The detector's dataset.
    • setMetricSetList

      @Stability(Stable) public void setMetricSetList(@NotNull List<Object> value)
      The detector's dataset.
    • getAnomalyDetectorDescription

      @Stability(Stable) @Nullable public String getAnomalyDetectorDescription()
      A description of the detector.
    • setAnomalyDetectorDescription

      @Stability(Stable) public void setAnomalyDetectorDescription(@Nullable String value)
      A description of the detector.
    • getAnomalyDetectorName

      @Stability(Stable) @Nullable public String getAnomalyDetectorName()
      The name of the detector.
    • setAnomalyDetectorName

      @Stability(Stable) public void setAnomalyDetectorName(@Nullable String value)
      The name of the detector.
    • getKmsKeyArn

      @Stability(Stable) @Nullable public String getKmsKeyArn()
      The ARN of the KMS key to use to encrypt your data.
    • setKmsKeyArn

      @Stability(Stable) public void setKmsKeyArn(@Nullable String value)
      The ARN of the KMS key to use to encrypt your data.