Sha256: 1f9f0db0ca75baf1d1d87f0755e0d8409dbbf52ca72e466598c545c5ea6e8d52

Contents?: true

Size: 1.17 KB

Versions: 26

Compression:

Stored size: 1.17 KB

Contents

module Awspec::Type
  class Route53HostedZone < Base
    def resource_via_client
      @resource_via_client ||= find_hosted_zone(@display_name)
    end

    def id
      @id ||= resource_via_client.id if resource_via_client
    end

    def resource_via_client_record_sets
      @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

26 entries across 26 versions & 1 rubygems

Version Path
awspec-0.69.1 lib/awspec/type/route53_hosted_zone.rb
awspec-0.69.0 lib/awspec/type/route53_hosted_zone.rb
awspec-0.68.0 lib/awspec/type/route53_hosted_zone.rb
awspec-0.67.1 lib/awspec/type/route53_hosted_zone.rb
awspec-0.67.0 lib/awspec/type/route53_hosted_zone.rb
awspec-0.66.2 lib/awspec/type/route53_hosted_zone.rb
awspec-0.66.1 lib/awspec/type/route53_hosted_zone.rb
awspec-0.66.0 lib/awspec/type/route53_hosted_zone.rb
awspec-0.65.2 lib/awspec/type/route53_hosted_zone.rb
awspec-0.65.1 lib/awspec/type/route53_hosted_zone.rb
awspec-0.65.0 lib/awspec/type/route53_hosted_zone.rb
awspec-0.64.0 lib/awspec/type/route53_hosted_zone.rb
awspec-0.63.1 lib/awspec/type/route53_hosted_zone.rb
awspec-0.63.0 lib/awspec/type/route53_hosted_zone.rb
awspec-0.62.1 lib/awspec/type/route53_hosted_zone.rb
awspec-0.62.0 lib/awspec/type/route53_hosted_zone.rb
awspec-0.61.1 lib/awspec/type/route53_hosted_zone.rb
awspec-0.61.0 lib/awspec/type/route53_hosted_zone.rb
awspec-0.60.1 lib/awspec/type/route53_hosted_zone.rb
awspec-0.60.0 lib/awspec/type/route53_hosted_zone.rb