Sha256: a88038bff83e0633db4bf8ded1dcec3e7e13706b9ec5307f4647de19b2fc3355

Contents?: true

Size: 1.12 KB

Versions: 34

Compression:

Stored size: 1.12 KB

Contents

module Awspec::Type
  class Route53HostedZone < Base
    def initialize(id)
      super
      @resource_via_client = find_hosted_zone(id)
      @id = @resource_via_client.id if @resource_via_client
      return unless @id
      @resource_via_client_record_sets = select_record_sets_by_hosted_zone_id(@id)
    end

    def has_record_set?(name, type, value, options = {})
      name.gsub!(/\*/, '\\\052') # wildcard support
      ret = @resource_via_client_record_sets.find do |record_set|
        # next if record_set.type != type.upcase
        next unless record_set.type.casecmp(type) == 0
        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

34 entries across 34 versions & 1 rubygems

Version Path
awspec-0.55.0 lib/awspec/type/route53_hosted_zone.rb
awspec-0.54.0 lib/awspec/type/route53_hosted_zone.rb
awspec-0.52.4 lib/awspec/type/route53_hosted_zone.rb
awspec-0.52.3 lib/awspec/type/route53_hosted_zone.rb
awspec-0.52.2 lib/awspec/type/route53_hosted_zone.rb
awspec-0.52.1 lib/awspec/type/route53_hosted_zone.rb
awspec-0.52.0 lib/awspec/type/route53_hosted_zone.rb
awspec-0.51.0 lib/awspec/type/route53_hosted_zone.rb
awspec-0.50.0 lib/awspec/type/route53_hosted_zone.rb
awspec-0.49.0 lib/awspec/type/route53_hosted_zone.rb
awspec-0.48.0 lib/awspec/type/route53_hosted_zone.rb
awspec-0.47.0 lib/awspec/type/route53_hosted_zone.rb
awspec-0.46.0 lib/awspec/type/route53_hosted_zone.rb
awspec-0.45.0 lib/awspec/type/route53_hosted_zone.rb
awspec-0.44.0 lib/awspec/type/route53_hosted_zone.rb
awspec-0.43.0 lib/awspec/type/route53_hosted_zone.rb
awspec-0.42.0 lib/awspec/type/route53_hosted_zone.rb
awspec-0.41.0 lib/awspec/type/route53_hosted_zone.rb
awspec-0.40.0 lib/awspec/type/route53_hosted_zone.rb
awspec-0.39.0 lib/awspec/type/route53_hosted_zone.rb