Sha256: 60af3a0d56fe9d92e58e8ef7624d638834561b6068a77186f47fcc6ac9e7237a

Contents?: true

Size: 998 Bytes

Versions: 14

Compression:

Stored size: 998 Bytes

Contents

class Lambda < Mapper
  def collect
    resources = []

    #
    # list_functions
    #
    @client.list_functions.each_with_index do |response, page|
      log(response.context.operation_name, page)

      response.functions.each do |function|
        struct = OpenStruct.new(function)
        struct.type = 'function'
        struct.arn = function.function_arn

        resources.push(struct.to_h)
      end
    end

    #
    # list_layers
    #
    @client.list_layers.each_with_index do |response, page|
      log(response.context.operation_name, page)

      response.layers.each do |layer|
        struct = OpenStruct.new(layer)
        struct.type = 'layer'
        struct.arn = layer.layer_arn

        # list_layer_versions
        struct.versions = @client.list_layer_versions({ layer_name: layer.layer_name }).layer_versions.map(&:to_h)
        log(response.context.operation_name, 'list_layer_versions')

        resources.push(struct.to_h)
      end
    end

    resources
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
aws_recon-0.2.17 lib/aws_recon/collectors/lambda.rb
aws_recon-0.2.16 lib/aws_recon/collectors/lambda.rb
aws_recon-0.2.15 lib/aws_recon/collectors/lambda.rb
aws_recon-0.2.14 lib/aws_recon/collectors/lambda.rb
aws_recon-0.2.13 lib/aws_recon/collectors/lambda.rb
aws_recon-0.2.12 lib/aws_recon/collectors/lambda.rb
aws_recon-0.2.11 lib/aws_recon/collectors/lambda.rb
aws_recon-0.2.10 lib/aws_recon/collectors/lambda.rb
aws_recon-0.2.9 lib/aws_recon/collectors/lambda.rb
aws_recon-0.2.8 lib/aws_recon/collectors/lambda.rb
aws_recon-0.2.7 lib/aws_recon/collectors/lambda.rb
aws_recon-0.2.6 lib/aws_recon/collectors/lambda.rb
aws_recon-0.2.5 lib/aws_recon/collectors/lambda.rb
aws_recon-0.2.4 lib/aws_recon/collectors/lambda.rb