Merge pull request #2779 from jonnangle/feature-failover-geo

Support GeoLocation and Failover on Route 53
This commit is contained in:
Bert Blommers 2020-03-06 08:39:08 +00:00 committed by GitHub
commit e895c6d6cd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 85 additions and 0 deletions

View file

@ -88,6 +88,8 @@ class RecordSet(BaseModel):
self.hosted_zone_name = kwargs.get("HostedZoneName")
self.hosted_zone_id = kwargs.get("HostedZoneId")
self.alias_target = kwargs.get("AliasTarget")
self.failover = kwargs.get("Failover")
self.geo_location = kwargs.get("GeoLocation")
@classmethod
def create_from_cloudformation_json(
@ -154,6 +156,16 @@ class RecordSet(BaseModel):
{% if record_set.ttl %}
<TTL>{{ record_set.ttl }}</TTL>
{% endif %}
{% if record_set.failover %}
<Failover>{{ record_set.failover }}</Failover>
{% endif %}
{% if record_set.geo_location %}
<GeoLocation>
{% for geo_key in ['ContinentCode','CountryCode','SubdivisionCode'] %}
{% if record_set.geo_location[geo_key] %}<{{ geo_key }}>{{ record_set.geo_location[geo_key] }}</{{ geo_key }}>{% endif %}
{% endfor %}
</GeoLocation>
{% endif %}
{% if record_set.alias_target %}
<AliasTarget>
<HostedZoneId>{{ record_set.alias_target['HostedZoneId'] }}</HostedZoneId>