Sha256: 2b4c6ba825848b0732a528adc9a4bcc50b4ddfd9d032c5a9a4fcb9e3b2203988

Contents?: true

Size: 1.17 KB

Versions: 30

Compression:

Stored size: 1.17 KB

Contents

module Awspec::Type
  class Route53HostedZone < Base
    attr_reader :resource_record_sets

    def initialize(id)
      super
      @resource = find_hosted_zone(id)
      @id = @resource[:id] if @resource
      return unless @id
      res = @route53_client.list_resource_record_sets({
                                                        hosted_zone_id: @id
                                                      })
      @resource_record_sets = res.resource_record_sets
    end

    def has_record_set?(name, type, value, options = {})
      ret = @resource_record_sets.find do |record_set|
        next if record_set.type != type.upcase
        options[:ttl] = record_set.ttl unless options[:ttl]
        if !record_set.resource_records.empty?
          v = record_set.resource_records.map { |r| r.value }.join("\n")
          record_set.name == name && \
          value == v && \
          record_set.ttl == options[:ttl]
        else
          # ALIAS
          record_set.name == name && \
          record_set.alias_target.dns_name == options[:alias_dns_name] && \
          record_set.alias_target.hosted_zone_id == options[:alias_hosted_zone_id]
        end
      end
    end
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
awspec-0.22.0 lib/awspec/type/route53_hosted_zone.rb
awspec-0.21.6 lib/awspec/type/route53_hosted_zone.rb
awspec-0.21.5 lib/awspec/type/route53_hosted_zone.rb
awspec-0.21.4 lib/awspec/type/route53_hosted_zone.rb
awspec-0.21.3 lib/awspec/type/route53_hosted_zone.rb
awspec-0.21.2 lib/awspec/type/route53_hosted_zone.rb
awspec-0.21.1 lib/awspec/type/route53_hosted_zone.rb
awspec-0.21.0 lib/awspec/type/route53_hosted_zone.rb
awspec-0.20.2 lib/awspec/type/route53_hosted_zone.rb
awspec-0.20.1 lib/awspec/type/route53_hosted_zone.rb
awspec-0.20.0 lib/awspec/type/route53_hosted_zone.rb
awspec-0.19.0 lib/awspec/type/route53_hosted_zone.rb
awspec-0.18.2 lib/awspec/type/route53_hosted_zone.rb
awspec-0.18.1 lib/awspec/type/route53_hosted_zone.rb
awspec-0.18.0 lib/awspec/type/route53_hosted_zone.rb
awspec-0.17.1 lib/awspec/type/route53_hosted_zone.rb
awspec-0.17.0 lib/awspec/type/route53_hosted_zone.rb
awspec-0.16.0 lib/awspec/type/route53_hosted_zone.rb
awspec-0.15.0 lib/awspec/type/route53_hosted_zone.rb
awspec-0.14.1 lib/awspec/type/route53_hosted_zone.rb