Module: Awspec::Helper::Finder::Lambda
- Included in:
- Awspec::Helper::Finder
- Defined in:
- lib/awspec/helper/finder/lambda.rb
Instance Method Summary collapse
Instance Method Details
#find_lambda(id) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/awspec/helper/finder/lambda.rb', line 4 def find_lambda(id) functions = [] marker = nil loop do res = @lambda_client.list_functions( marker: marker ) marker = res.next_marker break if res.functions.empty? res.functions.each do |function| if function.function_name == id || function.function_arn == id functions.push(function) end end break unless marker end return functions[0] if functions.count == 1 end |
#select_event_source_by_function_arn(function_arn) ⇒ Object
23 24 25 26 27 28 |
# File 'lib/awspec/helper/finder/lambda.rb', line 23 def select_event_source_by_function_arn(function_arn) res = @lambda_client.list_event_source_mappings({ function_name: function_arn }) res[:event_source_mappings] end |