Sha256: 3955a71d7c145437b9599ca92234bc98551365d0dbee141baa6d94e66333e628

Contents?: true

Size: 902 Bytes

Versions: 3

Compression:

Stored size: 902 Bytes

Contents

module Awspec::Helper
  module Finder
    module Lambda
      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
          (res.next_page? && res = res.next_page) || break
        end

        selected.single_resource(id)
      end

      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

      def select_all_lambda_functions
        lambda_client.list_functions.map do |response|
          response.functions
        end.flatten
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
awspec-1.18.2 lib/awspec/helper/finder/lambda.rb
awspec-1.18.1 lib/awspec/helper/finder/lambda.rb
awspec-1.18.0 lib/awspec/helper/finder/lambda.rb