Method: Awspec::Helper::Finder::Lambda#find_lambda

Defined in:
lib/awspec/helper/finder/lambda.rb

#find_lambda(id) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/awspec/helper/finder/lambda.rb', line 6

def find_lambda(id)
  selected = []
  res = lambda_client.list_functions

  loop do
    selected += res.functions.select do |function|
      function.function_name == id || function.function_arn == id
    end
    break if res.next_marker.nil?

    res = lambda_client.list_functions({
                                         marker: res.next_marker
                                       })
  end

  selected.single_resource(id)
end