Class: AWSCDK::Logs::CfnLogAnomalyDetectorProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
logs/cfn_log_anomaly_detector_props.rb

Overview

Properties for defining a CfnLogAnomalyDetector.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(account_id: nil, anomaly_visibility_time: nil, detector_name: nil, evaluation_frequency: nil, filter_pattern: nil, kms_key_id: nil, log_group_arn_list: nil) ⇒ CfnLogAnomalyDetectorProps

Returns a new instance of CfnLogAnomalyDetectorProps.

Parameters:

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

    The ID of the account to create the anomaly detector in.

  • anomaly_visibility_time (Numeric, nil) (defaults to: nil)

    The number of days to have visibility on an anomaly.

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

    A name for this anomaly detector.

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

    Specifies how often the anomaly detector is to run and look for anomalies.

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

    You can use this parameter to limit the anomaly detection model to examine only log events that match the pattern you specify here.

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

    Optionally assigns a AWS key to secure this anomaly detector and its findings.

  • log_group_arn_list (Array<String>, nil) (defaults to: nil)

    The ARN of the log group that is associated with this anomaly detector.



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'logs/cfn_log_anomaly_detector_props.rb', line 16

def initialize(account_id: nil, anomaly_visibility_time: nil, detector_name: nil, evaluation_frequency: nil, filter_pattern: nil, kms_key_id: nil, log_group_arn_list: nil)
  @account_id = 
  Jsii::Type.check_type(@account_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "accountId") unless @account_id.nil?
  @anomaly_visibility_time = anomaly_visibility_time
  Jsii::Type.check_type(@anomaly_visibility_time, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "anomalyVisibilityTime") unless @anomaly_visibility_time.nil?
  @detector_name = detector_name
  Jsii::Type.check_type(@detector_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "detectorName") unless @detector_name.nil?
  @evaluation_frequency = evaluation_frequency
  Jsii::Type.check_type(@evaluation_frequency, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "evaluationFrequency") unless @evaluation_frequency.nil?
  @filter_pattern = filter_pattern
  Jsii::Type.check_type(@filter_pattern, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "filterPattern") unless @filter_pattern.nil?
  @kms_key_id = kms_key_id
  Jsii::Type.check_type(@kms_key_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "kmsKeyId") unless @kms_key_id.nil?
  @log_group_arn_list = log_group_arn_list
  Jsii::Type.check_type(@log_group_arn_list, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "logGroupArnList") unless @log_group_arn_list.nil?
end

Instance Attribute Details

#account_idString? (readonly)

The ID of the account to create the anomaly detector in.



37
38
39
# File 'logs/cfn_log_anomaly_detector_props.rb', line 37

def 
  @account_id
end

#anomaly_visibility_timeNumeric? (readonly)

The number of days to have visibility on an anomaly.

After this time period has elapsed for an anomaly, it will be automatically baselined and the anomaly detector will treat new occurrences of a similar anomaly as normal. Therefore, if you do not correct the cause of an anomaly during the time period specified in AnomalyVisibilityTime , it will be considered normal going forward and will not be detected as an anomaly.



44
45
46
# File 'logs/cfn_log_anomaly_detector_props.rb', line 44

def anomaly_visibility_time
  @anomaly_visibility_time
end

#detector_nameString? (readonly)

A name for this anomaly detector.



49
50
51
# File 'logs/cfn_log_anomaly_detector_props.rb', line 49

def detector_name
  @detector_name
end

#evaluation_frequencyString? (readonly)

Specifies how often the anomaly detector is to run and look for anomalies.

Set this value according to the frequency that the log group receives new logs. For example, if the log group receives new log events every 10 minutes, then 15 minutes might be a good setting for EvaluationFrequency .



56
57
58
# File 'logs/cfn_log_anomaly_detector_props.rb', line 56

def evaluation_frequency
  @evaluation_frequency
end

#filter_patternString? (readonly)

You can use this parameter to limit the anomaly detection model to examine only log events that match the pattern you specify here.

For more information, see Filter and Pattern Syntax .



63
64
65
# File 'logs/cfn_log_anomaly_detector_props.rb', line 63

def filter_pattern
  @filter_pattern
end

#kms_key_idString? (readonly)

Optionally assigns a AWS key to secure this anomaly detector and its findings.

If a key is assigned, the anomalies found and the model used by this detector are encrypted at rest with the key. If a key is assigned to an anomaly detector, a user must have permissions for both this key and for the anomaly detector to retrieve information about the anomalies that it finds.

For more information about using a AWS key and to see the required IAM policy, see Use a AWS key with an anomaly detector .



72
73
74
# File 'logs/cfn_log_anomaly_detector_props.rb', line 72

def kms_key_id
  @kms_key_id
end

#log_group_arn_listArray<String>? (readonly)

The ARN of the log group that is associated with this anomaly detector.

You can specify only one log group ARN.



79
80
81
# File 'logs/cfn_log_anomaly_detector_props.rb', line 79

def log_group_arn_list
  @log_group_arn_list
end

Class Method Details

.jsii_propertiesObject



81
82
83
84
85
86
87
88
89
90
91
# File 'logs/cfn_log_anomaly_detector_props.rb', line 81

def self.jsii_properties
  {
    :account_id => "accountId",
    :anomaly_visibility_time => "anomalyVisibilityTime",
    :detector_name => "detectorName",
    :evaluation_frequency => "evaluationFrequency",
    :filter_pattern => "filterPattern",
    :kms_key_id => "kmsKeyId",
    :log_group_arn_list => "logGroupArnList",
  }
end

Instance Method Details

#to_jsiiObject



93
94
95
96
97
98
99
100
101
102
103
104
105
# File 'logs/cfn_log_anomaly_detector_props.rb', line 93

def to_jsii
  result = {}
  result.merge!({
    "accountId" => @account_id,
    "anomalyVisibilityTime" => @anomaly_visibility_time,
    "detectorName" => @detector_name,
    "evaluationFrequency" => @evaluation_frequency,
    "filterPattern" => @filter_pattern,
    "kmsKeyId" => @kms_key_id,
    "logGroupArnList" => @log_group_arn_list,
  })
  result.compact
end