Method: Jets::Resource::Associated#initialize

Defined in:
lib/jets/resource/associated.rb

#initialize(*definition) ⇒ Associated

Returns a new instance of Associated.



9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/jets/resource/associated.rb', line 9

def initialize(*definition)
  @definition = definition.flatten
  # Some associated resources require multiple resources for a single Lambda function. For
  # example `sqs_event` can create a `SQS::Queue` and `Lambda::EventSourceMapping`.  We set
  # a `multiple` flag so `add_logical_id_counter` can use it to avoid adding counter ids to
  # these type of resources. The `multiple` flag allows us to handle both:
  #
  #   1. Associated resources that contain multiple resources for a single Lambda function
  #   2. A single Lambda function with multiple events.  In this case, a counter is added
  #
  # Setting `multiple` to true means the counter id will not be added.
  @multiple_resources = false
end