Class: CfnGuardian::Models::LambdaAlarm

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

Instance Attribute Summary

Attributes inherited from BaseAlarm

#actions_enabled, #additional_notifiers, #alarm_action, #anomaly_detection, #comparison_operator, #datapoints_to_alarm, #dimensions, #enabled, #evaluate_low_sample_count_percentile, #evaluation_periods, #extended_statistic, #group, #maintenance_groups, #metric_name, #name, #namespace, #ok_action_disabled, #period, #resource_hash, #resource_id, #resource_name, #search_aggregation, #search_expression, #standard_deviation, #statistic, #tags, #threshold, #threshold_overridden, #treat_missing_data, #type, #unit

Instance Method Summary collapse

Methods inherited from BaseAlarm

#mark_threshold_overridden!

Constructor Details

#initialize(resource) ⇒ LambdaAlarm

Returns a new instance of LambdaAlarm.



447
448
449
450
451
452
453
454
455
456
457
458
459
460
# File 'lib/cfnguardian/models/alarm.rb', line 447

def initialize(resource)
  super(resource)
  @group = 'Lambda'
  @namespace = 'AWS/Lambda'
  if resource['Id'].include?(':')
    lambda_name, lambda_alias = resource['Id'].split(':', 2)
    @dimensions = { FunctionName: lambda_name, Resource: resource['Id'] }
  else
    @dimensions = { FunctionName: resource['Id'] }
  end     
  @statistic = 'Average'
  @evaluation_periods = 5
  @treat_missing_data = 'notBreaching'
end