Class: CfnGuardian::Resource::ElasticSearch

Inherits:
Base
  • Object
show all
Defined in:
lib/cfnguardian/resources/elastic_search.rb

Instance Method Summary collapse

Methods inherited from Base

#default_checks, #default_event_subscriptions, #default_events, #default_metric_filters, #get_alarms, #get_checks, #get_cost, #get_event_subscriptions, #get_events, #get_metric_filters, #initialize, #resource_exists?

Methods included from Logging

colors, included, logger, #logger, logger=

Constructor Details

This class inherits a constructor from CfnGuardian::Resource::Base

Instance Method Details

#default_alarmsObject



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# File 'lib/cfnguardian/resources/elastic_search.rb', line 4

def default_alarms    
    alarm = CfnGuardian::Models::ElasticSearchAlarm.new(@resource)
    alarm.name = 'NodeCount'
    alarm.metric_name = 'Nodes'
    alarm.threshold = 3
    alarm.evaluation_periods = 1440 # 24 hours
    alarm.datapoints_to_alarm = 1
    alarm.comparison_operator = 'LessThanOrEqualToThreshold'
    alarm.alarm_action = 'Critical'
    alarm.enabled = false
    @alarms.push(alarm)

    alarm = CfnGuardian::Models::ElasticSearchAlarm.new(@resource)
    alarm.name = 'JVMMemoryPressureWarning'
    alarm.metric_name = 'JVMMemoryPressure'
    alarm.threshold = 72
    alarm.evaluation_periods = 5
    alarm.datapoints_to_alarm = 3
    alarm.alarm_action = 'Warning'
    alarm.enabled = false
    @alarms.push(alarm)

    alarm = CfnGuardian::Models::ElasticSearchAlarm.new(@resource)
    alarm.name = 'JVMMemoryPressureCrit'
    alarm.metric_name = 'JVMMemoryPressure'
    alarm.threshold = 92
    alarm.evaluation_periods = 5
    alarm.alarm_action = 'Critical'
    alarm.enabled = false
    @alarms.push(alarm)

    alarm = CfnGuardian::Models::ElasticSearchAlarm.new(@resource)
    alarm.name = 'ClusterIndexWritesBlocked'
    alarm.metric_name = 'ClusterIndexWritesBlocked'
    alarm.threshold = 1
    alarm.evaluation_periods = 5
    alarm.alarm_action = 'Critical'
    @alarms.push(alarm)  
    
    alarm = CfnGuardian::Models::ElasticSearchAlarm.new(@resource)
    alarm.name = 'MasterNodeCPUUtilisationWarning'
    alarm.metric_name = 'MasterCPUUtilization'
    alarm.threshold = 75
    alarm.evaluation_periods = 60
    alarm.alarm_action = 'Warning'
    @alarms.push(alarm)  

    alarm = CfnGuardian::Models::ElasticSearchAlarm.new(@resource)
    alarm.name = 'MasterNodeCPUUtilisationCrit'
    alarm.metric_name = 'MasterCPUUtilization'
    alarm.threshold = 95
    alarm.evaluation_periods = 10
    alarm.alarm_action = 'Critical'
    @alarms.push(alarm)  

    alarm = CfnGuardian::Models::ElasticSearchAlarm.new(@resource)
    alarm.name = 'FreeStorageSpaceWarning'
    alarm.metric_name = 'FreeStorageSpace'
    alarm.threshold = 50000
    alarm.evaluation_periods = 1
    alarm.alarm_action = 'Warning'
    alarm.statistic = 'Minimum'
    alarm.comparison_operator = 'LessThanOrEqualToThreshold'
    @alarms.push(alarm)  

    alarm = CfnGuardian::Models::ElasticSearchAlarm.new(@resource)
    alarm.name = 'FreeStorageSpaceCrit'
    alarm.metric_name = 'FreeStorageSpace'
    alarm.threshold = 25000
    alarm.evaluation_periods = 1
    alarm.alarm_action = 'Critical'
    alarm.statistic = 'Minimum'
    alarm.comparison_operator = 'LessThanOrEqualToThreshold'
    @alarms.push(alarm)  
   
    alarm = CfnGuardian::Models::ElasticSearchAlarm.new(@resource)
    alarm.name = 'CPUUtilizationWarning'
    alarm.metric_name = 'CPUUtilization'
    alarm.threshold = 75
    alarm.evaluation_periods = 15
    alarm.datapoints_to_alarm = 3
    alarm.alarm_action = 'Warning'
    alarm.statistic = 'Average'
    @alarms.push(alarm)  

    alarm = CfnGuardian::Models::ElasticSearchAlarm.new(@resource)
    alarm.name = 'CPUUtilizationCrit'
    alarm.metric_name = 'CPUUtilization'
    alarm.threshold = 95
    alarm.evaluation_periods = 5
    alarm.datapoints_to_alarm = 3
    alarm.alarm_action = 'Critical'
    alarm.statistic = 'Average'
    @alarms.push(alarm)  

    alarm = CfnGuardian::Models::ElasticSearchAlarm.new(@resource)
    alarm.name = 'KMSKeyError'
    alarm.metric_name = 'KMSKeyError'
    alarm.threshold = 1
    alarm.evaluation_periods = 1
    alarm.alarm_action = 'Warning'
    alarm.statistic = 'Minimum'
    @alarms.push(alarm)  

    alarm = CfnGuardian::Models::ElasticSearchAlarm.new(@resource)
    alarm.name = 'KMSKeyInaccessible'
    alarm.metric_name = 'KMSKeyInaccessible'
    alarm.threshold = 1
    alarm.evaluation_periods = 1
    alarm.alarm_action = 'Critical'
    alarm.statistic = 'Minimum'
    alarm.enabled = false
    @alarms.push(alarm)  

    alarm = CfnGuardian::Models::ElasticSearchAlarm.new(@resource)
    alarm.name = 'ClusterStatusRed'
    alarm.metric_name = 'ClusterStatus.red'
    alarm.threshold = 1
    alarm.evaluation_periods = 1
    alarm.alarm_action = 'Critical'
    alarm.statistic = 'Minimum'
    @alarms.push(alarm)  

    alarm = CfnGuardian::Models::ElasticSearchAlarm.new(@resource)
    alarm.name = 'ClusterStatusYellow'
    alarm.metric_name = 'ClusterStatus.yellow'
    alarm.threshold = 1
    alarm.evaluation_periods = 1
    alarm.alarm_action = 'Warning'
    alarm.statistic = 'Minimum'
    @alarms.push(alarm)  

end