Class: Roadworker::Batch::Create
- Defined in:
- lib/roadworker/batch.rb
Instance Attribute Summary
Attributes inherited from Operation
#dry_run, #health_checks, #hosted_zone, #logger, #rrset
Instance Method Summary collapse
Methods inherited from Operation
#cname_first?, #initialize, #inspect, #op_size, #present_rrset, #sort_key, #to_s, #value_size
Methods included from Log
Constructor Details
This class inherits a constructor from Roadworker::Batch::Operation
Instance Method Details
#changes ⇒ Object
252 253 254 255 256 257 258 259 |
# File 'lib/roadworker/batch.rb', line 252 def changes [ { action: 'CREATE', resource_record_set: desired_rrset.to_h, }, ] end |
#desired_rrset ⇒ Hash
225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 |
# File 'lib/roadworker/batch.rb', line 225 def desired_rrset return @new_rrset if defined? @new_rrset @new_rrset = { name: rrset.name, type: rrset.type, } Route53Wrapper::RRSET_ATTRS.each do |attribute| value = rrset.send(attribute) next unless value case attribute when :dns_name attribute = :alias_target dns_name, dns_name_opts = value value = get_alias_target(dns_name, dns_name_opts) when :health_check attribute = :health_check_id value = get_health_check(value) end @new_rrset[attribute] = value end @new_rrset end |
#diff! ⇒ Object
261 262 263 264 265 |
# File 'lib/roadworker/batch.rb', line 261 def diff! log(:info, 'Create ResourceRecordSet', :cyan) do "#{desired_rrset[:name]} #{desired_rrset[:type]}#{ desired_rrset[:set_identifier] && " (#{desired_rrset[:set_identifier]})" }" end end |