Class: AWSCDK::CloudWatch::CfnLogAlarmProps

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

Overview

Properties for defining a CfnLogAlarm.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(comparison_operator:, query_results_to_alarm:, query_results_to_evaluate:, scheduled_query_configuration:, threshold:, action_log_line_count: nil, action_log_line_role_arn: nil, actions_enabled: nil, alarm_actions: nil, alarm_description: nil, alarm_name: nil, insufficient_data_actions: nil, ok_actions: nil, tags: nil, treat_missing_data: nil) ⇒ CfnLogAlarmProps

Returns a new instance of CfnLogAlarmProps.

Parameters:

  • comparison_operator (String)

    The arithmetic operation to use when comparing the specified threshold and the query results.

  • query_results_to_alarm (Numeric)

    The number of query results that must be breaching to trigger the alarm.

  • query_results_to_evaluate (Numeric)

    The number of query results over which data is compared to the specified threshold.

  • scheduled_query_configuration (AWSCDK::IResolvable, AWSCDK::CloudWatch::CfnLogAlarm::ScheduledQueryConfigurationProperty)

    The scheduled query configuration for the log alarm.

  • threshold (Numeric)

    The value to compare against the results of the scheduled query evaluation.

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

    The number of log lines to include in alarm notifications.

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

    The ARN of the IAM role that grants CloudWatch permissions to fetch log lines for alarm notifications.

  • actions_enabled (Boolean, AWSCDK::IResolvable, nil) (defaults to: nil)

    Indicates whether actions should be executed during any changes to the alarm state.

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

    The list of actions to execute when this alarm transitions into an ALARM state from any other state.

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

    The description of the log alarm.

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

    The name of the log alarm.

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

    The actions to execute when this alarm transitions to the INSUFFICIENT_DATA state from any other state.

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

    The actions to execute when this alarm transitions to the OK state from any other state.

  • tags (Array<AWSCDK::CfnTag>, nil) (defaults to: nil)

    A list of key-value pairs to associate with the log alarm.

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

    Sets how this alarm is to handle missing data points.



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'cloud_watch/cfn_log_alarm_props.rb', line 24

def initialize(comparison_operator:, query_results_to_alarm:, query_results_to_evaluate:, scheduled_query_configuration:, threshold:, action_log_line_count: nil, action_log_line_role_arn: nil, actions_enabled: nil, alarm_actions: nil, alarm_description: nil, alarm_name: nil, insufficient_data_actions: nil, ok_actions: nil, tags: nil, treat_missing_data: nil)
  @comparison_operator = comparison_operator
  Jsii::Type.check_type(@comparison_operator, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "comparisonOperator")
  @query_results_to_alarm = query_results_to_alarm
  Jsii::Type.check_type(@query_results_to_alarm, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "queryResultsToAlarm")
  @query_results_to_evaluate = query_results_to_evaluate
  Jsii::Type.check_type(@query_results_to_evaluate, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "queryResultsToEvaluate")
  @scheduled_query_configuration = scheduled_query_configuration.is_a?(Hash) ? ::AWSCDK::CloudWatch::CfnLogAlarm::ScheduledQueryConfigurationProperty.new(**scheduled_query_configuration.transform_keys(&:to_sym)) : scheduled_query_configuration
  Jsii::Type.check_type(@scheduled_query_configuration, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19jbG91ZHdhdGNoLkNmbkxvZ0FsYXJtLlNjaGVkdWxlZFF1ZXJ5Q29uZmlndXJhdGlvblByb3BlcnR5In1dfX0=")), "scheduledQueryConfiguration")
  @threshold = threshold
  Jsii::Type.check_type(@threshold, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "threshold")
  @action_log_line_count = action_log_line_count
  Jsii::Type.check_type(@action_log_line_count, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "actionLogLineCount") unless @action_log_line_count.nil?
  @action_log_line_role_arn = action_log_line_role_arn
  Jsii::Type.check_type(@action_log_line_role_arn, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "actionLogLineRoleArn") unless @action_log_line_role_arn.nil?
  @actions_enabled = actions_enabled
  Jsii::Type.check_type(@actions_enabled, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "actionsEnabled") unless @actions_enabled.nil?
  @alarm_actions = alarm_actions
  Jsii::Type.check_type(@alarm_actions, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "alarmActions") unless @alarm_actions.nil?
  @alarm_description = alarm_description
  Jsii::Type.check_type(@alarm_description, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "alarmDescription") unless @alarm_description.nil?
  @alarm_name = alarm_name
  Jsii::Type.check_type(@alarm_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "alarmName") unless @alarm_name.nil?
  @insufficient_data_actions = insufficient_data_actions
  Jsii::Type.check_type(@insufficient_data_actions, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "insufficientDataActions") unless @insufficient_data_actions.nil?
  @ok_actions = ok_actions
  Jsii::Type.check_type(@ok_actions, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "okActions") unless @ok_actions.nil?
  @tags = tags.is_a?(Array) ? tags.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::CfnTag.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : tags
  Jsii::Type.check_type(@tags, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLkNmblRhZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "tags") unless @tags.nil?
  @treat_missing_data = treat_missing_data
  Jsii::Type.check_type(@treat_missing_data, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "treatMissingData") unless @treat_missing_data.nil?
end

Instance Attribute Details

#action_log_line_countNumeric? (readonly)

The number of log lines to include in alarm notifications.

Valid values are 0 to 50.



90
91
92
# File 'cloud_watch/cfn_log_alarm_props.rb', line 90

def action_log_line_count
  @action_log_line_count
end

#action_log_line_role_arnString? (readonly)

The ARN of the IAM role that grants CloudWatch permissions to fetch log lines for alarm notifications.

Required when ActionLogLineCount is greater than 0.



97
98
99
# File 'cloud_watch/cfn_log_alarm_props.rb', line 97

def action_log_line_role_arn
  @action_log_line_role_arn
end

#actions_enabledBoolean, ... (readonly)

Note:

Default: - true

Indicates whether actions should be executed during any changes to the alarm state.

The default is TRUE.



105
106
107
# File 'cloud_watch/cfn_log_alarm_props.rb', line 105

def actions_enabled
  @actions_enabled
end

#alarm_actionsArray<String>? (readonly)

The list of actions to execute when this alarm transitions into an ALARM state from any other state.



110
111
112
# File 'cloud_watch/cfn_log_alarm_props.rb', line 110

def alarm_actions
  @alarm_actions
end

#alarm_descriptionString? (readonly)

The description of the log alarm.



115
116
117
# File 'cloud_watch/cfn_log_alarm_props.rb', line 115

def alarm_description
  @alarm_description
end

#alarm_nameString? (readonly)

The name of the log alarm.



120
121
122
# File 'cloud_watch/cfn_log_alarm_props.rb', line 120

def alarm_name
  @alarm_name
end

#comparison_operatorString (readonly)

The arithmetic operation to use when comparing the specified threshold and the query results.

Valid values are GreaterThanOrEqualToThreshold, GreaterThanThreshold, LessThanThreshold, and LessThanOrEqualToThreshold.



63
64
65
# File 'cloud_watch/cfn_log_alarm_props.rb', line 63

def comparison_operator
  @comparison_operator
end

#insufficient_data_actionsArray<String>? (readonly)

The actions to execute when this alarm transitions to the INSUFFICIENT_DATA state from any other state.



125
126
127
# File 'cloud_watch/cfn_log_alarm_props.rb', line 125

def insufficient_data_actions
  @insufficient_data_actions
end

#ok_actionsArray<String>? (readonly)

The actions to execute when this alarm transitions to the OK state from any other state.



130
131
132
# File 'cloud_watch/cfn_log_alarm_props.rb', line 130

def ok_actions
  @ok_actions
end

#query_results_to_alarmNumeric (readonly)

The number of query results that must be breaching to trigger the alarm.



68
69
70
# File 'cloud_watch/cfn_log_alarm_props.rb', line 68

def query_results_to_alarm
  @query_results_to_alarm
end

#query_results_to_evaluateNumeric (readonly)

The number of query results over which data is compared to the specified threshold.



73
74
75
# File 'cloud_watch/cfn_log_alarm_props.rb', line 73

def query_results_to_evaluate
  @query_results_to_evaluate
end

#scheduled_query_configurationAWSCDK::IResolvable, AWSCDK::CloudWatch::CfnLogAlarm::ScheduledQueryConfigurationProperty (readonly)

The scheduled query configuration for the log alarm.



78
79
80
# File 'cloud_watch/cfn_log_alarm_props.rb', line 78

def scheduled_query_configuration
  @scheduled_query_configuration
end

#tagsArray<AWSCDK::CfnTag>? (readonly)

A list of key-value pairs to associate with the log alarm.



135
136
137
# File 'cloud_watch/cfn_log_alarm_props.rb', line 135

def tags
  @tags
end

#thresholdNumeric (readonly)

The value to compare against the results of the scheduled query evaluation.



83
84
85
# File 'cloud_watch/cfn_log_alarm_props.rb', line 83

def threshold
  @threshold
end

#treat_missing_dataString? (readonly)

Sets how this alarm is to handle missing data points.

Valid values are breaching, notBreaching, ignore, and missing.



142
143
144
# File 'cloud_watch/cfn_log_alarm_props.rb', line 142

def treat_missing_data
  @treat_missing_data
end

Class Method Details

.jsii_propertiesObject



144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
# File 'cloud_watch/cfn_log_alarm_props.rb', line 144

def self.jsii_properties
  {
    :comparison_operator => "comparisonOperator",
    :query_results_to_alarm => "queryResultsToAlarm",
    :query_results_to_evaluate => "queryResultsToEvaluate",
    :scheduled_query_configuration => "scheduledQueryConfiguration",
    :threshold => "threshold",
    :action_log_line_count => "actionLogLineCount",
    :action_log_line_role_arn => "actionLogLineRoleArn",
    :actions_enabled => "actionsEnabled",
    :alarm_actions => "alarmActions",
    :alarm_description => "alarmDescription",
    :alarm_name => "alarmName",
    :insufficient_data_actions => "insufficientDataActions",
    :ok_actions => "okActions",
    :tags => "tags",
    :treat_missing_data => "treatMissingData",
  }
end

Instance Method Details

#to_jsiiObject



164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
# File 'cloud_watch/cfn_log_alarm_props.rb', line 164

def to_jsii
  result = {}
  result.merge!({
    "comparisonOperator" => @comparison_operator,
    "queryResultsToAlarm" => @query_results_to_alarm,
    "queryResultsToEvaluate" => @query_results_to_evaluate,
    "scheduledQueryConfiguration" => @scheduled_query_configuration,
    "threshold" => @threshold,
    "actionLogLineCount" => @action_log_line_count,
    "actionLogLineRoleArn" => @action_log_line_role_arn,
    "actionsEnabled" => @actions_enabled,
    "alarmActions" => @alarm_actions,
    "alarmDescription" => @alarm_description,
    "alarmName" => @alarm_name,
    "insufficientDataActions" => @insufficient_data_actions,
    "okActions" => @ok_actions,
    "tags" => @tags,
    "treatMissingData" => @treat_missing_data,
  })
  result.compact
end