Skip to content

Instantly share code, notes, and snippets.

@charleskirk
Created October 23, 2012 18:24
Show Gist options
  • Save charleskirk/3940533 to your computer and use it in GitHub Desktop.
Save charleskirk/3940533 to your computer and use it in GitHub Desktop.
Help
@list[:hosted_zones].each do |zone|
records = @r53.client.list_resource_record_sets({:hosted_zone_id => zone[:id].gsub('/hostedzone/','')})
records.resource_record_sets.each do |record|
if required_records.include? record[:type]
new_record = {:name => record[:name], :type => record[:type], :set_identifier => record[:set_indentifier],
:region => record[:region]}
if record.has_key?("alias_target")
new_record[:alias_target_zone] = record[:alias_target][:hosted_zone_id]
new_record[:alias_target_dns_name] = record[:alias_target][:dns_name]
end
DnsRecor.create(new_record)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment