Class: CfnGuardian::Models::BaseAlarm

Inherits:
Object
  • Object
show all
Defined in:
lib/cfnguardian/models/alarm.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(resource) ⇒ BaseAlarm

Returns a new instance of BaseAlarm.



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/cfnguardian/models/alarm.rb', line 35

def initialize(resource)
  @type = 'Alarm'
  @group = nil
  @name = ''
  @metric_name = nil
  @namespace = nil
  @dimensions = nil
  @threshold = 0
  @period = 60
  @evaluation_periods = 1
  @comparison_operator = 'GreaterThanThreshold'
  @statistic = 'Maximum'
  @actions_enabled = true
  @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 = []
  @tags = {}
end

Instance Attribute Details

#actions_enabledObject

Returns the value of attribute actions_enabled.



11
12
13
# File 'lib/cfnguardian/models/alarm.rb', line 11

def actions_enabled
  @actions_enabled
end

#additional_notifiersObject

Returns the value of attribute additional_notifiers.



11
12
13
# File 'lib/cfnguardian/models/alarm.rb', line 11

def additional_notifiers
  @additional_notifiers
end

#alarm_actionObject

Returns the value of attribute alarm_action.



11
12
13
# File 'lib/cfnguardian/models/alarm.rb', line 11

def alarm_action
  @alarm_action
end

#comparison_operatorObject

Returns the value of attribute comparison_operator.



11
12
13
# File 'lib/cfnguardian/models/alarm.rb', line 11

def comparison_operator
  @comparison_operator
end

#datapoints_to_alarmObject

Returns the value of attribute datapoints_to_alarm.



11
12
13
# File 'lib/cfnguardian/models/alarm.rb', line 11

def datapoints_to_alarm
  @datapoints_to_alarm
end

#dimensionsObject

Returns the value of attribute dimensions.



11
12
13
# File 'lib/cfnguardian/models/alarm.rb', line 11

def dimensions
  @dimensions
end

#enabledObject

Returns the value of attribute enabled.



11
12
13
# File 'lib/cfnguardian/models/alarm.rb', line 11

def enabled
  @enabled
end

#evaluate_low_sample_count_percentileObject

Returns the value of attribute evaluate_low_sample_count_percentile.



11
12
13
# File 'lib/cfnguardian/models/alarm.rb', line 11

def evaluate_low_sample_count_percentile
  @evaluate_low_sample_count_percentile
end

#evaluation_periodsObject

Returns the value of attribute evaluation_periods.



11
12
13
# File 'lib/cfnguardian/models/alarm.rb', line 11

def evaluation_periods
  @evaluation_periods
end

#extended_statisticObject

Returns the value of attribute extended_statistic.



11
12
13
# File 'lib/cfnguardian/models/alarm.rb', line 11

def extended_statistic
  @extended_statistic
end

#groupObject

Returns the value of attribute group.



11
12
13
# File 'lib/cfnguardian/models/alarm.rb', line 11

def group
  @group
end

#maintenance_groupsObject

Returns the value of attribute maintenance_groups.



11
12
13
# File 'lib/cfnguardian/models/alarm.rb', line 11

def maintenance_groups
  @maintenance_groups
end

#metric_nameObject

Returns the value of attribute metric_name.



11
12
13
# File 'lib/cfnguardian/models/alarm.rb', line 11

def metric_name
  @metric_name
end

#nameObject

Returns the value of attribute name.



11
12
13
# File 'lib/cfnguardian/models/alarm.rb', line 11

def name
  @name
end

#namespaceObject

Returns the value of attribute namespace.



11
12
13
# File 'lib/cfnguardian/models/alarm.rb', line 11

def namespace
  @namespace
end

#periodObject

Returns the value of attribute period.



11
12
13
# File 'lib/cfnguardian/models/alarm.rb', line 11

def period
  @period
end

#resource_hashObject (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_idObject

Returns the value of attribute resource_id.



11
12
13
# File 'lib/cfnguardian/models/alarm.rb', line 11

def resource_id
  @resource_id
end

#resource_nameObject

Returns the value of attribute resource_name.



11
12
13
# File 'lib/cfnguardian/models/alarm.rb', line 11

def resource_name
  @resource_name
end

#statisticObject

Returns the value of attribute statistic.



11
12
13
# File 'lib/cfnguardian/models/alarm.rb', line 11

def statistic
  @statistic
end

#tagsObject

Returns the value of attribute tags.



11
12
13
# File 'lib/cfnguardian/models/alarm.rb', line 11

def tags
  @tags
end

#thresholdObject

Returns the value of attribute threshold.



11
12
13
# File 'lib/cfnguardian/models/alarm.rb', line 11

def threshold
  @threshold
end

#treat_missing_dataObject

Returns the value of attribute treat_missing_data.



11
12
13
# File 'lib/cfnguardian/models/alarm.rb', line 11

def treat_missing_data
  @treat_missing_data
end

#typeObject (readonly)

Returns the value of attribute type.



8
9
10
# File 'lib/cfnguardian/models/alarm.rb', line 8

def type
  @type
end

#unitObject

Returns the value of attribute unit.



11
12
13
# File 'lib/cfnguardian/models/alarm.rb', line 11

def unit
  @unit
end