Route53 is a little particular - updates are represented as a transaction 
consisting of destroy + create. 

it looks like the modify method on Fog::AWS::DNS::Record handles that for you 

Fred


On 28 August 2015 at 14:48:25, Brett Cave ([email protected]) wrote:

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/uObTJlynbUI

I 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...




--
You received this message because you are subscribed to the Google Groups 
"ruby-fog" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"ruby-fog" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to