Class: ApartmentAcmeClient::DnsApi::Route53

Inherits:
Object
  • Object
show all
Defined in:
lib/apartment_acme_client/dns_api/route53.rb

Overview

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(requested_domain:, dns_record_label:, record_type:, values:) ⇒ Route53

Returns a new instance of Route53.



22
23
24
25
26
27
# File 'lib/apartment_acme_client/dns_api/route53.rb', line 22

def initialize(requested_domain:, dns_record_label:, record_type:, values:)
  @requested_domain = requested_domain
  @label = dns_record_label
  @record_type = record_type
  @values = values
end

Instance Attribute Details

#labelObject (readonly)

the DNS TXT record label (full label, including domain)



12
13
14
# File 'lib/apartment_acme_client/dns_api/route53.rb', line 12

def label
  @label
end

#record_typeObject (readonly)

will be TXT



15
16
17
# File 'lib/apartment_acme_client/dns_api/route53.rb', line 15

def record_type
  @record_type
end

#requested_domainObject (readonly)

The domain being requested for DNS update e.g. “site.example.com”



9
10
11
# File 'lib/apartment_acme_client/dns_api/route53.rb', line 9

def requested_domain
  @requested_domain
end

#valuesObject (readonly)

array of value keys to be written (for wildcard certs, you’ll have one for *.example.com, and one for example.com) e.g. [“One”, “Two”]



20
21
22
# File 'lib/apartment_acme_client/dns_api/route53.rb', line 20

def values
  @values
end

Instance Method Details

#write_recordObject

NOTE: If you get error like:

“Invalid Resource Record: FATAL problem: InvalidCharacterString (Value should be enclosed in quotation marks) encountered with <value>”

this means that the “Value” should include escape quotes. e.g. values: [“"Something"”, “"Other Thing"”]



37
38
39
# File 'lib/apartment_acme_client/dns_api/route53.rb', line 37

def write_record
  route53.change_resource_record_sets(options)
end