Hi, I am trying to use Fog to manage Route53 zones / records. I came across this post, which covered some of it:
https://groups.google.com/forum/#!topic/ruby-fog/uObTJlynbUII wanted to confirm whether this was me using it incorrectly vs limited functionality of the library.
Use Case: Modify the SOA record of a domain by name (in-place edit, not a "destroy" and "create" - haven't tried this approach, and not going to as I don't think SOA can be removed or should be)
require 'fog'
newttl=3600
dns = Fog::DNS::AWS.new({ ... <connection params>})
zone = dns.zones.all.select { |zone| zone.domain == "
mydomain.net." } [0]
soaRecord = zone.records.get("
mydomain.net.", record_type = "SOA") # soaRecord.value[0] = "
ns-1234.awsdns.com.
awsdns-hostmaster.amazon.com 1 7200 900 1209600 86400"
soaRecord.value = [soaRecord[0].value.gsub(/ [0-9]+$/, " #{newttl}") # the ttl has now been changed on the soaRecord from 86400 to 3600.
soaRecord.save
Fog::DNS::AWS::Error: InvalidChangeBatch => Tried to create resource record set [name='mydomain.net.', type='SOA'] but it already exists
I'm looking through the change_resource_record_sets.rb now...