Class: Jets::Resource::Logs::SubscriptionFilter

Inherits:
Base
  • Object
show all
Defined in:
lib/jets/resource/logs/subscription_filter.rb

Instance Method Summary collapse

Methods inherited from Base

#replacements, #resource

Constructor Details

#initialize(props = {}) ⇒ SubscriptionFilter

Returns a new instance of SubscriptionFilter.



4
5
6
# File 'lib/jets/resource/logs/subscription_filter.rb', line 4

def initialize(props={})
  @props = props # associated_properties from dsl.rb
end

Instance Method Details

#definitionObject



8
9
10
11
12
13
14
15
# File 'lib/jets/resource/logs/subscription_filter.rb', line 8

def definition
  {
    log_logical_id => {
      type: "AWS::Logs::SubscriptionFilter",
      properties: merged_properties,
    }
  }
end

#log_logical_idObject



27
28
29
# File 'lib/jets/resource/logs/subscription_filter.rb', line 27

def log_logical_id
  "{namespace}_subscription_filter"
end

#merged_propertiesObject

Do not name this method properties, that is a computed method of ‘Jets::Resource::Base`



18
19
20
21
22
23
24
25
# File 'lib/jets/resource/logs/subscription_filter.rb', line 18

def merged_properties
  {
    destination_arn: "!GetAtt {namespace}LambdaFunction.Arn",
    filter_pattern: "", # matches everything https://amzn.to/2N3b39I
    # log_group_name: string # will be set by log_event
    # role_arn: string # only required for kinensis, we dont use this for Lambda
  }.deep_merge(@props)
end