Sha256: 4ae20a960315c9cf574aa477abc32f6866c0da20647bd80b93e744af4f719cbd

Contents?: true

Size: 781 Bytes

Versions: 11

Compression:

Stored size: 781 Bytes

Contents

# frozen_string_literal: true

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

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

      response.hosted_zones.each do |zone|
        struct = OpenStruct.new(zone.to_h)
        struct.type = 'zone'
        struct.arn = "aws:route53:#{@region}:#{@account}:zone/#{zone.name}"
        struct.logging_config = @client
                                .list_query_logging_configs({ hosted_zone_id: zone.id })
                                .query_logging_configs.first.to_h

        resources.push(struct.to_h)
      end
    end

    resources
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
aws_recon-0.4.2 lib/aws_recon/collectors/route53.rb
aws_recon-0.4.1 lib/aws_recon/collectors/route53.rb
aws_recon-0.4.0 lib/aws_recon/collectors/route53.rb
aws_recon-0.3.5 lib/aws_recon/collectors/route53.rb
aws_recon-0.3.4 lib/aws_recon/collectors/route53.rb
aws_recon-0.3.3 lib/aws_recon/collectors/route53.rb
aws_recon-0.3.2 lib/aws_recon/collectors/route53.rb
aws_recon-0.3.1 lib/aws_recon/collectors/route53.rb
aws_recon-0.3.0 lib/aws_recon/collectors/route53.rb
aws_recon-0.2.36 lib/aws_recon/collectors/route53.rb
aws_recon-0.2.35 lib/aws_recon/collectors/route53.rb