Class: CfnGuardian::Resource::InternalPort
- Inherits:
-
Base
- Object
- Base
- CfnGuardian::Resource::InternalPort
show all
- Defined in:
- lib/cfnguardian/resources/internal_port.rb
Instance Method Summary
collapse
Methods inherited from Base
#default_event_subscriptions, #default_metric_filters, #get_alarms, #get_checks, #get_cost, #get_event_subscriptions, #get_events, #get_metric_filters, #resource_exists?
Methods included from Logging
colors, included, logger, #logger, logger=
Constructor Details
#initialize(resource, override_group = nil) ⇒ InternalPort
4
5
6
7
8
|
# File 'lib/cfnguardian/resources/internal_port.rb', line 4
def initialize(resource, override_group = nil)
super(resource, override_group)
@resource_list = resource['Hosts']
@environment = resource['Environment']
end
|
Instance Method Details
#default_alarms ⇒ Object
10
11
12
13
14
15
16
17
18
19
20
21
22
|
# File 'lib/cfnguardian/resources/internal_port.rb', line 10
def default_alarms
@resource_list.each do |host|
alarm = CfnGuardian::Models::InternalPortAlarm.new(host)
alarm.name = 'EndpointAvailable'
alarm.metric_name = 'Available'
@alarms.push(alarm)
alarm = CfnGuardian::Models::InternalPortAlarm.new(host)
alarm.name = 'EndpointTimeTaken'
alarm.metric_name = 'TimeTaken'
@alarms.push(alarm)
end
end
|
#default_checks ⇒ Object
28
29
30
|
# File 'lib/cfnguardian/resources/internal_port.rb', line 28
def default_checks()
@checks.push(CfnGuardian::Models::InternalPortCheck.new(@resource))
end
|
#default_events ⇒ Object
24
25
26
|
# File 'lib/cfnguardian/resources/internal_port.rb', line 24
def default_events()
@resource_list.each {|host| @events.push(CfnGuardian::Models::InternalPortEvent.new(host,@environment))}
end
|