Class: AWSCDK::CloudWatch::CfnAnomalyDetector::SingleMetricAnomalyDetectorProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
cloud_watch/cfn_anomaly_detector.rb

Overview

Designates the CloudWatch metric and statistic that provides the time series the anomaly detector uses as input.

If you have enabled unified cross-account observability, and this account is a monitoring account, the metric can be in the same account or a source account.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(account_id: nil, dimensions: nil, metric_name: nil, namespace: nil, stat: nil) ⇒ SingleMetricAnomalyDetectorProperty

Returns a new instance of SingleMetricAnomalyDetectorProperty.

Parameters:

  • account_id (String, nil) (defaults to: nil)

    If the CloudWatch metric that provides the time series that the anomaly detector uses as input is in another account, specify that account ID here.

  • dimensions (AWSCDK::IResolvable, Array<AWSCDK::IResolvable, AWSCDK::CloudWatch::CfnAnomalyDetector::DimensionProperty>, nil) (defaults to: nil)

    The metric dimensions to create the anomaly detection model for.

  • metric_name (String, nil) (defaults to: nil)

    The name of the metric to create the anomaly detection model for.

  • namespace (String, nil) (defaults to: nil)

    The namespace of the metric to create the anomaly detection model for.

  • stat (String, nil) (defaults to: nil)

    The statistic to use for the metric and anomaly detection model.



1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
# File 'cloud_watch/cfn_anomaly_detector.rb', line 1081

def initialize(account_id: nil, dimensions: nil, metric_name: nil, namespace: nil, stat: nil)
  @account_id = 
  Jsii::Type.check_type(@account_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "accountId") unless @account_id.nil?
  @dimensions = dimensions
  Jsii::Type.check_type(@dimensions, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5DZm5Bbm9tYWx5RGV0ZWN0b3IuRGltZW5zaW9uUHJvcGVydHkifV19fSwia2luZCI6ImFycmF5In19XX19")), "dimensions") unless @dimensions.nil?
  @metric_name = metric_name
  Jsii::Type.check_type(@metric_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "metricName") unless @metric_name.nil?
  @namespace = namespace
  Jsii::Type.check_type(@namespace, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "namespace") unless @namespace.nil?
  @stat = stat
  Jsii::Type.check_type(@stat, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "stat") unless @stat.nil?
end

Instance Attribute Details

#account_idString? (readonly)

If the CloudWatch metric that provides the time series that the anomaly detector uses as input is in another account, specify that account ID here.

If you omit this parameter, the current account is used.



1100
1101
1102
# File 'cloud_watch/cfn_anomaly_detector.rb', line 1100

def 
  @account_id
end

#dimensionsAWSCDK::IResolvable, ... (readonly)

The metric dimensions to create the anomaly detection model for.



1105
1106
1107
# File 'cloud_watch/cfn_anomaly_detector.rb', line 1105

def dimensions
  @dimensions
end

#metric_nameString? (readonly)

The name of the metric to create the anomaly detection model for.



1110
1111
1112
# File 'cloud_watch/cfn_anomaly_detector.rb', line 1110

def metric_name
  @metric_name
end

#namespaceString? (readonly)

The namespace of the metric to create the anomaly detection model for.



1115
1116
1117
# File 'cloud_watch/cfn_anomaly_detector.rb', line 1115

def namespace
  @namespace
end

#statString? (readonly)

The statistic to use for the metric and anomaly detection model.



1120
1121
1122
# File 'cloud_watch/cfn_anomaly_detector.rb', line 1120

def stat
  @stat
end

Class Method Details

.jsii_propertiesObject



1122
1123
1124
1125
1126
1127
1128
1129
1130
# File 'cloud_watch/cfn_anomaly_detector.rb', line 1122

def self.jsii_properties
  {
    :account_id => "accountId",
    :dimensions => "dimensions",
    :metric_name => "metricName",
    :namespace => "namespace",
    :stat => "stat",
  }
end

Instance Method Details

#to_jsiiObject



1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
# File 'cloud_watch/cfn_anomaly_detector.rb', line 1132

def to_jsii
  result = {}
  result.merge!({
    "accountId" => @account_id,
    "dimensions" => @dimensions,
    "metricName" => @metric_name,
    "namespace" => @namespace,
    "stat" => @stat,
  })
  result.compact
end