Sha256: 323dda082cd5c1a3c2161d7db38ed0b229cf051582f1460a85d362a6a2ed6ab4

Contents?: true

Size: 908 Bytes

Versions: 125

Compression:

Stored size: 908 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
        res = lambda_client.list_functions.map do |responce|
          responce.functions
        end.flatten
      end
    end
  end
end

Version data entries

125 entries across 125 versions & 2 rubygems

Version Path
awspec-0.82.1 lib/awspec/helper/finder/lambda.rb
awspec-0.82.0 lib/awspec/helper/finder/lambda.rb
awspec-0.81.1 lib/awspec/helper/finder/lambda.rb
awspec-0.81.0 lib/awspec/helper/finder/lambda.rb
awspec-0.80.1 lib/awspec/helper/finder/lambda.rb
awspec-0.80.0 lib/awspec/helper/finder/lambda.rb
awspec-0.79.2 lib/awspec/helper/finder/lambda.rb
awspec-0.79.1 lib/awspec/helper/finder/lambda.rb
awspec-0.79.0 lib/awspec/helper/finder/lambda.rb
awspec-0.78.1 lib/awspec/helper/finder/lambda.rb
awspec-0.77.1 lib/awspec/helper/finder/lambda.rb
awspec-0.77.0 lib/awspec/helper/finder/lambda.rb
awspec-0.76.1 lib/awspec/helper/finder/lambda.rb
awspec-0.76.0 lib/awspec/helper/finder/lambda.rb
awspec-0.75.2 lib/awspec/helper/finder/lambda.rb
awspec-0.75.1 lib/awspec/helper/finder/lambda.rb
awspec-0.75.0 lib/awspec/helper/finder/lambda.rb
awspec-0.74.1 lib/awspec/helper/finder/lambda.rb
awspec-0.74.0 lib/awspec/helper/finder/lambda.rb
awspec-0.73.2 lib/awspec/helper/finder/lambda.rb