Class: CfnGuardian::Models::MetricFilter

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(log_group, filter) ⇒ MetricFilter

Returns a new instance of MetricFilter.



16
17
18
19
20
21
22
23
24
# File 'lib/cfnguardian/models/metric_filter.rb', line 16

def initialize(log_group,filter)
  @type = 'MetricFilter'
  @name = Digest::MD5.hexdigest(log_group + filter['MetricName'])
  @log_group = log_group
  @pattern = filter['Pattern']
  @metric_value = filter.fetch('MetricValue', '1').to_s
  @metric_name = filter['MetricName']
  @metric_namespace = "MetricFilters"
end

Instance Attribute Details

#log_groupObject

Returns the value of attribute log_group.



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

def log_group
  @log_group
end

#metric_nameObject

Returns the value of attribute metric_name.



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

def metric_name
  @metric_name
end

#metric_namespaceObject (readonly)

Returns the value of attribute metric_namespace.



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

def metric_namespace
  @metric_namespace
end

#metric_valueObject

Returns the value of attribute metric_value.



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

def metric_value
  @metric_value
end

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end

#patternObject

Returns the value of attribute pattern.



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

def pattern
  @pattern
end

#typeObject (readonly)

Returns the value of attribute type.



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

def type
  @type
end