Sha256: f341e605ef737528b2bb1b4ee48047eb5713a7ecf3a9173db3c4c6bb849f2cff

Contents?: true

Size: 1.02 KB

Versions: 28

Compression:

Stored size: 1.02 KB

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
          break if res.next_marker.nil?
          res = lambda_client.list_functions({
                                               marker: res.next_marker
                                             })
        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

28 entries across 28 versions & 3 rubygems

Version Path
awspec-1.25.1 lib/awspec/helper/finder/lambda.rb
awspec-1.25.0 lib/awspec/helper/finder/lambda.rb
awspec-1.24.4 lib/awspec/helper/finder/lambda.rb
awspec-1.24.3 lib/awspec/helper/finder/lambda.rb
awspec-1.24.2 lib/awspec/helper/finder/lambda.rb
awspec-1.24.1 lib/awspec/helper/finder/lambda.rb
awspec-1.24.0 lib/awspec/helper/finder/lambda.rb
awspec-1.23.0 lib/awspec/helper/finder/lambda.rb
awspec-1.22.1 lib/awspec/helper/finder/lambda.rb
awspec-1.22.0 lib/awspec/helper/finder/lambda.rb
awspec-1.21.1 lib/awspec/helper/finder/lambda.rb
awspec-1.21.0 lib/awspec/helper/finder/lambda.rb
awspec-1.20.0 lib/awspec/helper/finder/lambda.rb
awspec-1.19.2 lib/awspec/helper/finder/lambda.rb
awspec-1.19.1 lib/awspec/helper/finder/lambda.rb
awspec-1.19.0 lib/awspec/helper/finder/lambda.rb
cthiesfork-awspec-1.2.4 lib/awspec/helper/finder/lambda.rb
awspec-api_gateway_extended-1.2.4 lib/awspec/helper/finder/lambda.rb
awspec-api_gateway_extended-1.2.3 lib/awspec/helper/finder/lambda.rb
awspec-1.18.6 lib/awspec/helper/finder/lambda.rb