Class: CfnGuardian::Resource::Acm

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

Instance Method Summary collapse

Methods inherited from Base

#default_checks, #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
# File 'lib/cfnguardian/resources/acm.rb', line 4

def default_alarms    
alarm = CfnGuardian::Models::AcmAlarm.new(@resource)
alarm.name = 'CertificateExpiry'
alarm.metric_name = 'DaysToExpiry'
alarm.statistic = 'Average'
alarm.threshold = 30
alarm.comparison_operator = 'LessThanThreshold'
alarm.evaluation_periods = 1
alarm.period = 86400
@alarms.push(alarm)
end

#default_event_subscriptionsObject



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/cfnguardian/resources/acm.rb', line 16

def default_event_subscriptions()
  event_subscription = CfnGuardian::Models::AcmEventSubscription.new(@resource)
  event_subscription.name = 'AcmCertificateNearExpiry'
  event_subscription.detail_type = 'ACM Certificate Approaching Expiration'
  event_subscription.source = 'aws.acm'
  event_subscription.detail = {
  'DaysToExpiry' => [31]
  }
  @event_subscriptions.push(event_subscription)

  event_subscription = CfnGuardian::Models::AcmEventSubscription.new(@resource)
  event_subscription.name = 'AcmCertificateExpired'
  event_subscription.detail_type = 'ACM Certificate Expired'
  event_subscription.source = 'aws.acm'
  @event_subscriptions.push(event_subscription)

  event_subscription = CfnGuardian::Models::AcmEventSubscription.new(@resource)
  event_subscription.name = 'AcmRenewalActionRequired'
  event_subscription.detail_type = 'ACM Certificate Renewal Action Required'
  event_subscription.source = 'aws.acm'
  @event_subscriptions.push(event_subscription)
end