Class: CfnGuardian::Models::BaseAlarm
- Inherits:
-
Object
- Object
- CfnGuardian::Models::BaseAlarm
- Defined in:
- lib/cfnguardian/models/alarm.rb
Direct Known Subclasses
AcmAlarm, AmazonMQBrokerAlarm, AmazonMQRabbitMQBrokerAlarm, AmazonMQRabbitMQNodeAlarm, AmazonMQRabbitMQQueueAlarm, ApiGatewayAlarm, ApplicationTargetGroupAlarm, AutoScalingGroupAlarm, AzureFileAlarm, BatchAlarm, CloudFrontDistributionAlarm, DMSClusterAlarm, DMSTaskAlarm, DocumentDBClusterAlarm, DomainExpiryAlarm, DynamoDBTableAlarm, ECSClusterAlarm, ECSServiceAlarm, EKSContainerInsightsClusterAlarm, EKSContainerInsightsNamespaceAlarm, Ec2InstanceAlarm, ElastiCacheReplicationGroupAlarm, ElasticFileSystemAlarm, ElasticLoadBalancerAlarm, ElasticSearchAlarm, GlueAlarm, HttpAlarm, JenkinsAlarm, KafkaClusterAlarm, KafkaTopicAlarm, LambdaAlarm, LogGroupAlarm, NetworkTargetGroupAlarm, NrpeAlarm, PortAlarm, RDSClusterInstanceAlarm, RDSInstanceAlarm, RedshiftClusterAlarm, SFTPAlarm, SQSQueueAlarm, SqlAlarm, SslAlarm, StepFunctionsAlarm, TLSAlarm, VPNConnectionAlarm, VPNTunnelAlarm, WebSocketAlarm
Instance Attribute Summary collapse
-
#actions_enabled ⇒ Object
Returns the value of attribute actions_enabled.
-
#additional_notifiers ⇒ Object
Returns the value of attribute additional_notifiers.
-
#alarm_action ⇒ Object
Returns the value of attribute alarm_action.
-
#anomaly_detection ⇒ Object
Returns the value of attribute anomaly_detection.
-
#comparison_operator ⇒ Object
Returns the value of attribute comparison_operator.
-
#datapoints_to_alarm ⇒ Object
Returns the value of attribute datapoints_to_alarm.
-
#dimensions ⇒ Object
Returns the value of attribute dimensions.
-
#enabled ⇒ Object
Returns the value of attribute enabled.
-
#evaluate_low_sample_count_percentile ⇒ Object
Returns the value of attribute evaluate_low_sample_count_percentile.
-
#evaluation_periods ⇒ Object
Returns the value of attribute evaluation_periods.
-
#extended_statistic ⇒ Object
Returns the value of attribute extended_statistic.
-
#group ⇒ Object
Returns the value of attribute group.
-
#maintenance_groups ⇒ Object
Returns the value of attribute maintenance_groups.
-
#metric_name ⇒ Object
Returns the value of attribute metric_name.
-
#name ⇒ Object
Returns the value of attribute name.
-
#namespace ⇒ Object
Returns the value of attribute namespace.
-
#ok_action_disabled ⇒ Object
Returns the value of attribute ok_action_disabled.
-
#period ⇒ Object
Returns the value of attribute period.
-
#resource_hash ⇒ Object
readonly
Returns the value of attribute resource_hash.
-
#resource_id ⇒ Object
Returns the value of attribute resource_id.
-
#resource_name ⇒ Object
Returns the value of attribute resource_name.
-
#search_aggregation ⇒ Object
Returns the value of attribute search_aggregation.
-
#search_expression ⇒ Object
Returns the value of attribute search_expression.
-
#standard_deviation ⇒ Object
Returns the value of attribute standard_deviation.
-
#statistic ⇒ Object
Returns the value of attribute statistic.
-
#tags ⇒ Object
Returns the value of attribute tags.
-
#threshold ⇒ Object
Returns the value of attribute threshold.
-
#threshold_overridden ⇒ Object
readonly
Returns the value of attribute threshold_overridden.
-
#treat_missing_data ⇒ Object
Returns the value of attribute treat_missing_data.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#unit ⇒ Object
Returns the value of attribute unit.
Instance Method Summary collapse
-
#initialize(resource) ⇒ BaseAlarm
constructor
A new instance of BaseAlarm.
-
#mark_threshold_overridden! ⇒ Object
Internal-only marker used to track that Threshold was explicitly set via a config override (as opposed to a resource group's own default_alarms definition).
Constructor Details
#initialize(resource) ⇒ BaseAlarm
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/cfnguardian/models/alarm.rb', line 41 def initialize(resource) @type = 'Alarm' @group = nil @name = '' @metric_name = nil @namespace = nil @dimensions = nil @threshold = 0 @threshold_overridden = false @period = 60 @evaluation_periods = 1 @comparison_operator = 'GreaterThanThreshold' @statistic = 'Maximum' @actions_enabled = true @ok_action_disabled = false @datapoints_to_alarm = nil @extended_statistic = nil @evaluate_low_sample_count_percentile = nil @unit = nil @enabled = true @resource_hash = Digest::MD5.hexdigest resource['Id'] @resource_id = resource['Id'] @resource_name = resource.fetch('Name', nil) @alarm_action = 'Critical' @treat_missing_data = nil @maintenance_groups = [] @additional_notifiers = [] = {} @search_expression = nil @search_aggregation = nil @anomaly_detection = false @standard_deviation = nil end |
Instance Attribute Details
#actions_enabled ⇒ Object
Returns the value of attribute actions_enabled.
12 13 14 |
# File 'lib/cfnguardian/models/alarm.rb', line 12 def actions_enabled @actions_enabled end |
#additional_notifiers ⇒ Object
Returns the value of attribute additional_notifiers.
12 13 14 |
# File 'lib/cfnguardian/models/alarm.rb', line 12 def additional_notifiers @additional_notifiers end |
#alarm_action ⇒ Object
Returns the value of attribute alarm_action.
12 13 14 |
# File 'lib/cfnguardian/models/alarm.rb', line 12 def alarm_action @alarm_action end |
#anomaly_detection ⇒ Object
Returns the value of attribute anomaly_detection.
12 13 14 |
# File 'lib/cfnguardian/models/alarm.rb', line 12 def anomaly_detection @anomaly_detection end |
#comparison_operator ⇒ Object
Returns the value of attribute comparison_operator.
12 13 14 |
# File 'lib/cfnguardian/models/alarm.rb', line 12 def comparison_operator @comparison_operator end |
#datapoints_to_alarm ⇒ Object
Returns the value of attribute datapoints_to_alarm.
12 13 14 |
# File 'lib/cfnguardian/models/alarm.rb', line 12 def datapoints_to_alarm @datapoints_to_alarm end |
#dimensions ⇒ Object
Returns the value of attribute dimensions.
12 13 14 |
# File 'lib/cfnguardian/models/alarm.rb', line 12 def dimensions @dimensions end |
#enabled ⇒ Object
Returns the value of attribute enabled.
12 13 14 |
# File 'lib/cfnguardian/models/alarm.rb', line 12 def enabled @enabled end |
#evaluate_low_sample_count_percentile ⇒ Object
Returns the value of attribute evaluate_low_sample_count_percentile.
12 13 14 |
# File 'lib/cfnguardian/models/alarm.rb', line 12 def evaluate_low_sample_count_percentile @evaluate_low_sample_count_percentile end |
#evaluation_periods ⇒ Object
Returns the value of attribute evaluation_periods.
12 13 14 |
# File 'lib/cfnguardian/models/alarm.rb', line 12 def evaluation_periods @evaluation_periods end |
#extended_statistic ⇒ Object
Returns the value of attribute extended_statistic.
12 13 14 |
# File 'lib/cfnguardian/models/alarm.rb', line 12 def extended_statistic @extended_statistic end |
#group ⇒ Object
Returns the value of attribute group.
12 13 14 |
# File 'lib/cfnguardian/models/alarm.rb', line 12 def group @group end |
#maintenance_groups ⇒ Object
Returns the value of attribute maintenance_groups.
12 13 14 |
# File 'lib/cfnguardian/models/alarm.rb', line 12 def maintenance_groups @maintenance_groups end |
#metric_name ⇒ Object
Returns the value of attribute metric_name.
12 13 14 |
# File 'lib/cfnguardian/models/alarm.rb', line 12 def metric_name @metric_name end |
#name ⇒ Object
Returns the value of attribute name.
12 13 14 |
# File 'lib/cfnguardian/models/alarm.rb', line 12 def name @name end |
#namespace ⇒ Object
Returns the value of attribute namespace.
12 13 14 |
# File 'lib/cfnguardian/models/alarm.rb', line 12 def namespace @namespace end |
#ok_action_disabled ⇒ Object
Returns the value of attribute ok_action_disabled.
12 13 14 |
# File 'lib/cfnguardian/models/alarm.rb', line 12 def ok_action_disabled @ok_action_disabled end |
#period ⇒ Object
Returns the value of attribute period.
12 13 14 |
# File 'lib/cfnguardian/models/alarm.rb', line 12 def period @period end |
#resource_hash ⇒ Object (readonly)
Returns the value of attribute resource_hash.
8 9 10 |
# File 'lib/cfnguardian/models/alarm.rb', line 8 def resource_hash @resource_hash end |
#resource_id ⇒ Object
Returns the value of attribute resource_id.
12 13 14 |
# File 'lib/cfnguardian/models/alarm.rb', line 12 def resource_id @resource_id end |
#resource_name ⇒ Object
Returns the value of attribute resource_name.
12 13 14 |
# File 'lib/cfnguardian/models/alarm.rb', line 12 def resource_name @resource_name end |
#search_aggregation ⇒ Object
Returns the value of attribute search_aggregation.
12 13 14 |
# File 'lib/cfnguardian/models/alarm.rb', line 12 def search_aggregation @search_aggregation end |
#search_expression ⇒ Object
Returns the value of attribute search_expression.
12 13 14 |
# File 'lib/cfnguardian/models/alarm.rb', line 12 def search_expression @search_expression end |
#standard_deviation ⇒ Object
Returns the value of attribute standard_deviation.
12 13 14 |
# File 'lib/cfnguardian/models/alarm.rb', line 12 def standard_deviation @standard_deviation end |
#statistic ⇒ Object
Returns the value of attribute statistic.
12 13 14 |
# File 'lib/cfnguardian/models/alarm.rb', line 12 def statistic @statistic end |
#tags ⇒ Object
Returns the value of attribute tags.
12 13 14 |
# File 'lib/cfnguardian/models/alarm.rb', line 12 def end |
#threshold ⇒ Object
Returns the value of attribute threshold.
12 13 14 |
# File 'lib/cfnguardian/models/alarm.rb', line 12 def threshold @threshold end |
#threshold_overridden ⇒ Object (readonly)
Returns the value of attribute threshold_overridden.
8 9 10 |
# File 'lib/cfnguardian/models/alarm.rb', line 8 def threshold_overridden @threshold_overridden end |
#treat_missing_data ⇒ Object
Returns the value of attribute treat_missing_data.
12 13 14 |
# File 'lib/cfnguardian/models/alarm.rb', line 12 def treat_missing_data @treat_missing_data end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
8 9 10 |
# File 'lib/cfnguardian/models/alarm.rb', line 8 def type @type end |
#unit ⇒ Object
Returns the value of attribute unit.
12 13 14 |
# File 'lib/cfnguardian/models/alarm.rb', line 12 def unit @unit end |
Instance Method Details
#mark_threshold_overridden! ⇒ Object
Internal-only marker used to track that Threshold was explicitly set via a config override (as opposed to a resource group's own default_alarms definition). This is intentionally not exposed as a public writer so a YAML config cannot set ThresholdOverridden directly and bypass the "can't combine Threshold and AnomalyDetection" validation.
85 86 87 |
# File 'lib/cfnguardian/models/alarm.rb', line 85 def mark_threshold_overridden! @threshold_overridden = true end |