Class: CfnGuardian::Resource::KafkaTopic

Inherits:
Base
  • Object
show all
Defined in:
lib/cfnguardian/resources/kafka_topic.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, #resource_exists?

Methods included from Logging

colors, included, logger, #logger, logger=

Constructor Details

#initialize(resource, override_group = nil) ⇒ KafkaTopic

Returns a new instance of KafkaTopic.



4
5
6
7
# File 'lib/cfnguardian/resources/kafka_topic.rb', line 4

def initialize(resource, override_group = nil)
  super(resource, override_group)
  @brokers_list = resource['Brokers']
end

Instance Method Details

#default_alarmsObject



9
10
11
12
13
14
15
16
17
18
# File 'lib/cfnguardian/resources/kafka_topic.rb', line 9

def default_alarms
  @brokers_list.each do |broker|  
    alarm = CfnGuardian::Models::KafkaTopicAlarm.new(@resource,broker)
    alarm.name = "Broker#{broker}-MessagesInPerSec"
    alarm.metric_name = 'MessagesInPerSec'
    alarm.threshold = 5
    alarm.comparison_operator = 'LessThanThreshold'
    @alarms.push(alarm)
  end
end