Sha256: 79a4eed02c5cf8ee7c32dc395d0dd92ed3986449e80c84f0bbc02189eb385b33

Contents?: true

Size: 1.47 KB

Versions: 28

Compression:

Stored size: 1.47 KB

Contents

module Awspec::Helper
  module Finder
    module Route53
      def find_hosted_zone(id)
        res = route53_client.list_hosted_zones
        selected = []
        loop do
          res.hosted_zones.each do |hosted_zone|
            if hosted_zone[:name] == id || hosted_zone[:id] == '/hostedzone/' + id || hosted_zone[:id] == id
              selected.push(hosted_zone)
            end
          end

          break unless res.is_truncated
          res = route53_client.list_hosted_zones({
                                                   marker: res.next_marker
                                                 })
        end
        selected.single_resource(id)
      end

      def select_record_sets_by_hosted_zone_id(id)
        selected = []
        res = route53_client.list_resource_record_sets({
                                                         hosted_zone_id: id
                                                       })
        loop do
          selected += res.resource_record_sets
          break unless res.is_truncated

          res = route53_client.list_resource_record_sets({
                                                           hosted_zone_id: id,
                                                           start_record_name: res.next_record_name,
                                                           start_record_type: res.next_record_type
                                                         })
        end
        selected
      end
    end
  end
end

Version data entries

28 entries across 28 versions & 3 rubygems

Version Path
awspec-1.25.1 lib/awspec/helper/finder/route53.rb
awspec-1.25.0 lib/awspec/helper/finder/route53.rb
awspec-1.24.4 lib/awspec/helper/finder/route53.rb
awspec-1.24.3 lib/awspec/helper/finder/route53.rb
awspec-1.24.2 lib/awspec/helper/finder/route53.rb
awspec-1.24.1 lib/awspec/helper/finder/route53.rb
awspec-1.24.0 lib/awspec/helper/finder/route53.rb
awspec-1.23.0 lib/awspec/helper/finder/route53.rb
awspec-1.22.1 lib/awspec/helper/finder/route53.rb
awspec-1.22.0 lib/awspec/helper/finder/route53.rb
awspec-1.21.1 lib/awspec/helper/finder/route53.rb
awspec-1.21.0 lib/awspec/helper/finder/route53.rb
awspec-1.20.0 lib/awspec/helper/finder/route53.rb
awspec-1.19.2 lib/awspec/helper/finder/route53.rb
awspec-1.19.1 lib/awspec/helper/finder/route53.rb
awspec-1.19.0 lib/awspec/helper/finder/route53.rb
cthiesfork-awspec-1.2.4 lib/awspec/helper/finder/route53.rb
awspec-api_gateway_extended-1.2.4 lib/awspec/helper/finder/route53.rb
awspec-api_gateway_extended-1.2.3 lib/awspec/helper/finder/route53.rb
awspec-1.18.6 lib/awspec/helper/finder/route53.rb