Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/route53.rb
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,8 @@ def update(name,type,ttl,values,comment=nil, zone_apex = nil)
@ttl = ttl unless ttl.nil?
@values = values unless values.nil?
@zone_apex = zone_apex unless zone_apex.nil?
@zone_apex = nil unless @zone_apex

@zone.perform_actions([
{:action => "DELETE", :record => prev},
{:action => "CREATE", :record => self},
Expand Down
8 changes: 6 additions & 2 deletions lib/route53/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def parsed_options?
opts.on('--weight [WEIGHT]', String, "Specify a Weight for a record") { |weight| @options.weight = weight }
opts.on('--ident [IDENTIFIER]', String, "Specify a unique identifier for a record") { |ident| @options.ident = ident }
opts.on('--values [VALUE1],[VALUE2],[VALUE3]', Array, "Specify one or multiple values for a record") { |value| @options.values = value }
opts.on('--zone-apex-id [ZONE_APEX_ID]', String, "Specify a zone apex if for the record") { |zone_apex| @options.zone_apex = zone_apex }
opts.on('--zone-apex-id [ZONE_APEX_ID]', String, "Specify a zone apex if for the record") { |zone_apex| @options.zone_apex = zone_apex || false }

opts.on('-m', '--comment [COMMENT]', String, "Provide a comment for this operation") { |comment| @options.comment = comment }

Expand Down Expand Up @@ -277,7 +277,11 @@ def change_record
end
records.each do |r|
puts "Modifying Record #{r.name}"
resp = r.update(@options.name,@options.dnstype,@options.ttl,@options.values,comment=nil)
if !@options.zone_apex.nil? && !@options.zone_apex && @options.ttl.nil?
$stderr.puts "ERROR: must provide --ttl if --zone_apex is set to empty string"
exit 1
end
resp = r.update(@options.name,@options.dnstype,@options.ttl,@options.values,@options.comment,@options.zone_apex)
pending_wait(resp)
puts "Record Modified." unless resp.error?
end
Expand Down