Sha256: 6e7d49122cc2080f56342751e1a0e6b3702bb88368072bd910558bb03ca1b229

Contents?: true

Size: 555 Bytes

Versions: 18

Compression:

Stored size: 555 Bytes

Contents

class DynamoDB < Mapper
  #
  # Returns an array of resources.
  #
  def collect
    resources = []

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

      # describe_table
      response.table_names.each do |table_name|
        struct = OpenStruct.new(@client.describe_table({ table_name: table_name }).table.to_h)
        struct.type = 'table'
        struct.arn = struct.table_arn

        resources.push(struct.to_h)
      end
    end

    resources
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
aws_recon-0.2.18 lib/aws_recon/collectors/dynamodb.rb
aws_recon-0.2.17 lib/aws_recon/collectors/dynamodb.rb
aws_recon-0.2.16 lib/aws_recon/collectors/dynamodb.rb
aws_recon-0.2.15 lib/aws_recon/collectors/dynamodb.rb
aws_recon-0.2.14 lib/aws_recon/collectors/dynamodb.rb
aws_recon-0.2.13 lib/aws_recon/collectors/dynamodb.rb
aws_recon-0.2.12 lib/aws_recon/collectors/dynamodb.rb
aws_recon-0.2.11 lib/aws_recon/collectors/dynamodb.rb
aws_recon-0.2.10 lib/aws_recon/collectors/dynamodb.rb
aws_recon-0.2.9 lib/aws_recon/collectors/dynamodb.rb
aws_recon-0.2.8 lib/aws_recon/collectors/dynamodb.rb
aws_recon-0.2.7 lib/aws_recon/collectors/dynamodb.rb
aws_recon-0.2.6 lib/aws_recon/collectors/dynamodb.rb
aws_recon-0.2.5 lib/aws_recon/collectors/dynamodb.rb
aws_recon-0.2.4 lib/aws_recon/collectors/dynamodb.rb
aws_recon-0.2.3 lib/aws_recon/collectors/dynamodb.rb
aws_recon-0.2.2 lib/aws_recon/collectors/dynamodb.rb
aws_recon-0.2.1 lib/aws_recon/collectors/dynamodb.rb