Sha256: ad552a6e9816507129c57f4d0ebf581ba8b9cbcc76a635a3df79a02034a0db1e

Contents?: true

Size: 1.07 KB

Versions: 34

Compression:

Stored size: 1.07 KB

Contents

# frozen_string_literal: true

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

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

      struct = OpenStruct.new(response)
      struct.type = 'limits'
      struct.arn = "arn:aws:dynamodb:#{@region}:#{@account}/limits"

      resources.push(struct.to_h)
    end

    #
    # 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
        struct.continuous_backups_description = @client.describe_continuous_backups({ table_name: table_name }).continuous_backups_description.to_h

        resources.push(struct.to_h)
      end
    end

    resources
  end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
aws_recon-0.5.33 lib/aws_recon/collectors/dynamodb.rb
aws_recon-0.5.32 lib/aws_recon/collectors/dynamodb.rb
aws_recon-0.5.31 lib/aws_recon/collectors/dynamodb.rb
aws_recon-0.5.30 lib/aws_recon/collectors/dynamodb.rb
aws_recon-0.5.29 lib/aws_recon/collectors/dynamodb.rb
aws_recon-0.5.28 lib/aws_recon/collectors/dynamodb.rb
aws_recon-0.5.27 lib/aws_recon/collectors/dynamodb.rb
aws_recon-0.5.26 lib/aws_recon/collectors/dynamodb.rb
aws_recon-0.5.25 lib/aws_recon/collectors/dynamodb.rb
aws_recon-0.5.24 lib/aws_recon/collectors/dynamodb.rb
aws_recon-0.5.23 lib/aws_recon/collectors/dynamodb.rb
aws_recon-0.5.22 lib/aws_recon/collectors/dynamodb.rb
aws_recon-0.5.21 lib/aws_recon/collectors/dynamodb.rb
aws_recon-0.5.20 lib/aws_recon/collectors/dynamodb.rb
aws_recon-0.5.19 lib/aws_recon/collectors/dynamodb.rb
aws_recon-0.5.18 lib/aws_recon/collectors/dynamodb.rb
aws_recon-0.5.17 lib/aws_recon/collectors/dynamodb.rb
aws_recon-0.5.16 lib/aws_recon/collectors/dynamodb.rb
aws_recon-0.5.15 lib/aws_recon/collectors/dynamodb.rb
aws_recon-0.5.14 lib/aws_recon/collectors/dynamodb.rb