Class: AWSCDK::Lightsail::CfnAlarmProps
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::Lightsail::CfnAlarmProps
- Defined in:
- lightsail/cfn_alarm_props.rb
Overview
Properties for defining a CfnAlarm.
Instance Attribute Summary collapse
-
#alarm_name ⇒ String
readonly
The name of the alarm.
-
#comparison_operator ⇒ String
readonly
The arithmetic operation to use when comparing the specified statistic and threshold.
-
#contact_protocols ⇒ Array<String>?
readonly
The contact protocols for the alarm, such as
Email,SMS(text messaging), or both. -
#datapoints_to_alarm ⇒ Numeric?
readonly
The number of data points within the evaluation periods that must be breaching to cause the alarm to go to the
ALARMstate. -
#evaluation_periods ⇒ Numeric
readonly
The number of periods over which data is compared to the specified threshold.
-
#metric_name ⇒ String
readonly
The name of the metric associated with the alarm.
-
#monitored_resource_name ⇒ String
readonly
The name of the Lightsail resource that the alarm monitors.
-
#notification_enabled ⇒ Boolean, ...
readonly
A Boolean value indicating whether the alarm is enabled.
-
#notification_triggers ⇒ Array<String>?
readonly
The alarm states that trigger a notification.
-
#threshold ⇒ Numeric
readonly
The value against which the specified statistic is compared.
-
#treat_missing_data ⇒ String?
readonly
Specifies how the alarm handles missing data points.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(alarm_name:, comparison_operator:, evaluation_periods:, metric_name:, monitored_resource_name:, threshold:, contact_protocols: nil, datapoints_to_alarm: nil, notification_enabled: nil, notification_triggers: nil, treat_missing_data: nil) ⇒ CfnAlarmProps
constructor
A new instance of CfnAlarmProps.
- #to_jsii ⇒ Object
Constructor Details
#initialize(alarm_name:, comparison_operator:, evaluation_periods:, metric_name:, monitored_resource_name:, threshold:, contact_protocols: nil, datapoints_to_alarm: nil, notification_enabled: nil, notification_triggers: nil, treat_missing_data: nil) ⇒ CfnAlarmProps
Returns a new instance of CfnAlarmProps.
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lightsail/cfn_alarm_props.rb', line 20 def initialize(alarm_name:, comparison_operator:, evaluation_periods:, metric_name:, monitored_resource_name:, threshold:, contact_protocols: nil, datapoints_to_alarm: nil, notification_enabled: nil, notification_triggers: nil, treat_missing_data: nil) @alarm_name = alarm_name Jsii::Type.check_type(@alarm_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "alarmName") @comparison_operator = comparison_operator Jsii::Type.check_type(@comparison_operator, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "comparisonOperator") @evaluation_periods = evaluation_periods Jsii::Type.check_type(@evaluation_periods, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "evaluationPeriods") @metric_name = metric_name Jsii::Type.check_type(@metric_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "metricName") @monitored_resource_name = monitored_resource_name Jsii::Type.check_type(@monitored_resource_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "monitoredResourceName") @threshold = threshold Jsii::Type.check_type(@threshold, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "threshold") @contact_protocols = contact_protocols Jsii::Type.check_type(@contact_protocols, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "contactProtocols") unless @contact_protocols.nil? @datapoints_to_alarm = datapoints_to_alarm Jsii::Type.check_type(@datapoints_to_alarm, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "datapointsToAlarm") unless @datapoints_to_alarm.nil? @notification_enabled = notification_enabled Jsii::Type.check_type(@notification_enabled, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "notificationEnabled") unless @notification_enabled.nil? @notification_triggers = notification_triggers Jsii::Type.check_type(@notification_triggers, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "notificationTriggers") unless @notification_triggers.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
#alarm_name ⇒ String (readonly)
The name of the alarm.
49 50 51 |
# File 'lightsail/cfn_alarm_props.rb', line 49 def alarm_name @alarm_name end |
#comparison_operator ⇒ String (readonly)
The arithmetic operation to use when comparing the specified statistic and threshold.
54 55 56 |
# File 'lightsail/cfn_alarm_props.rb', line 54 def comparison_operator @comparison_operator end |
#contact_protocols ⇒ Array<String>? (readonly)
The contact protocols for the alarm, such as Email , SMS (text messaging), or both.
Allowed Values : Email | SMS
81 82 83 |
# File 'lightsail/cfn_alarm_props.rb', line 81 def contact_protocols @contact_protocols end |
#datapoints_to_alarm ⇒ Numeric? (readonly)
The number of data points within the evaluation periods that must be breaching to cause the alarm to go to the ALARM state.
86 87 88 |
# File 'lightsail/cfn_alarm_props.rb', line 86 def datapoints_to_alarm @datapoints_to_alarm end |
#evaluation_periods ⇒ Numeric (readonly)
The number of periods over which data is compared to the specified threshold.
59 60 61 |
# File 'lightsail/cfn_alarm_props.rb', line 59 def evaluation_periods @evaluation_periods end |
#metric_name ⇒ String (readonly)
The name of the metric associated with the alarm.
64 65 66 |
# File 'lightsail/cfn_alarm_props.rb', line 64 def metric_name @metric_name end |
#monitored_resource_name ⇒ String (readonly)
The name of the Lightsail resource that the alarm monitors.
69 70 71 |
# File 'lightsail/cfn_alarm_props.rb', line 69 def monitored_resource_name @monitored_resource_name end |
#notification_enabled ⇒ Boolean, ... (readonly)
A Boolean value indicating whether the alarm is enabled.
91 92 93 |
# File 'lightsail/cfn_alarm_props.rb', line 91 def notification_enabled @notification_enabled end |
#notification_triggers ⇒ Array<String>? (readonly)
The alarm states that trigger a notification.
To specify the
OKandINSUFFICIENT_DATAvalues, you must also specifyContactProtocolsvalues. Otherwise, theOKandINSUFFICIENT_DATAvalues will not take effect and the stack will drift.
Allowed Values : OK | ALARM | INSUFFICIENT_DATA
100 101 102 |
# File 'lightsail/cfn_alarm_props.rb', line 100 def notification_triggers @notification_triggers end |
#threshold ⇒ Numeric (readonly)
The value against which the specified statistic is compared.
74 75 76 |
# File 'lightsail/cfn_alarm_props.rb', line 74 def threshold @threshold end |
#treat_missing_data ⇒ String? (readonly)
Specifies how the alarm handles missing data points.
An alarm can treat missing data in the following ways:
breaching- Assumes the missing data is not within the threshold. Missing data counts towards the number of times that the metric is not within the threshold.not_breaching- Assumes the missing data is within the threshold. Missing data does not count towards the number of times that the metric is not within the threshold.ignore- Ignores the missing data. Maintains the current alarm state.missing- Missing data is treated as missing.
112 113 114 |
# File 'lightsail/cfn_alarm_props.rb', line 112 def treat_missing_data @treat_missing_data end |
Class Method Details
.jsii_properties ⇒ Object
114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 |
# File 'lightsail/cfn_alarm_props.rb', line 114 def self.jsii_properties { :alarm_name => "alarmName", :comparison_operator => "comparisonOperator", :evaluation_periods => "evaluationPeriods", :metric_name => "metricName", :monitored_resource_name => "monitoredResourceName", :threshold => "threshold", :contact_protocols => "contactProtocols", :datapoints_to_alarm => "datapointsToAlarm", :notification_enabled => "notificationEnabled", :notification_triggers => "notificationTriggers", :treat_missing_data => "treatMissingData", } end |
Instance Method Details
#to_jsii ⇒ Object
130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 |
# File 'lightsail/cfn_alarm_props.rb', line 130 def to_jsii result = {} result.merge!({ "alarmName" => @alarm_name, "comparisonOperator" => @comparison_operator, "evaluationPeriods" => @evaluation_periods, "metricName" => @metric_name, "monitoredResourceName" => @monitored_resource_name, "threshold" => @threshold, "contactProtocols" => @contact_protocols, "datapointsToAlarm" => @datapoints_to_alarm, "notificationEnabled" => @notification_enabled, "notificationTriggers" => @notification_triggers, "treatMissingData" => @treat_missing_data, }) result.compact end |