Skip to content
This repository has been archived by the owner on Oct 19, 2023. It is now read-only.

Commit

Permalink
Merge pull request #217 from rapid7/backward-compat-recordset
Browse files Browse the repository at this point in the history
Maintain backwards compatability with route53
  • Loading branch information
erran-r7 authored Nov 2, 2016
2 parents b26428e + d94da4e commit 95ca621
Showing 1 changed file with 20 additions and 8 deletions.
28 changes: 20 additions & 8 deletions lib/convection/model/template/resource/aws_route53_recordset.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,28 @@ class Route53RecordSet < Resource
property :record_type, 'Type'
property :weight, 'Weight'

def alias_target(&block)
a = ResourceProperty::Route53AliasTarget.new(self)
a.instance_exec(&block) if block
properties['AliasTarget'].set(a)
def alias_target(tgt = nil, &block)
if tgt
# Maintain backwards compatability
alias_tgt tgt
else
# Add new resource_property functionality
a = ResourceProperty::Route53AliasTarget.new(self)
a.instance_exec(&block) if block
properties['AliasTarget'].set(a)
end
end

def geo_location(&block)
g = ResourceProperty::Route53GeoLocation.new(self)
g.instance_exec(&block) if block
properties['GeoLocation'].set(g)
def geo_location(geo = nil, &block)
if geo
# Maintain backwards compatability
geo_loc geo
else
# Add new resource_property functionality
g = ResourceProperty::Route53GeoLocation.new(self)
g.instance_exec(&block) if block
properties['GeoLocation'].set(g)
end
end
end
end
Expand Down

0 comments on commit 95ca621

Please sign in to comment.