Fix route53 alias response.
This commit * includes the work by @elliotmb in #1694, * removes the AliasTarget.DNSName copy into a RecordSet.Value, * fixes and adds tests.
This commit is contained in:
parent
664b27d8e7
commit
9bd15b5a09
3 changed files with 51 additions and 10 deletions
|
|
@ -85,6 +85,7 @@ class RecordSet(BaseModel):
|
|||
self.health_check = kwargs.get('HealthCheckId')
|
||||
self.hosted_zone_name = kwargs.get('HostedZoneName')
|
||||
self.hosted_zone_id = kwargs.get('HostedZoneId')
|
||||
self.alias_target = kwargs.get('AliasTarget')
|
||||
|
||||
@classmethod
|
||||
def create_from_cloudformation_json(cls, resource_name, cloudformation_json, region_name):
|
||||
|
|
@ -143,6 +144,13 @@ class RecordSet(BaseModel):
|
|||
{% if record_set.ttl %}
|
||||
<TTL>{{ record_set.ttl }}</TTL>
|
||||
{% endif %}
|
||||
{% if record_set.alias_target %}
|
||||
<AliasTarget>
|
||||
<HostedZoneId>{{ record_set.alias_target['HostedZoneId'] }}</HostedZoneId>
|
||||
<DNSName>{{ record_set.alias_target['DNSName'] }}</DNSName>
|
||||
<EvaluateTargetHealth>{{ record_set.alias_target['EvaluateTargetHealth'] }}</EvaluateTargetHealth>
|
||||
</AliasTarget>
|
||||
{% else %}
|
||||
<ResourceRecords>
|
||||
{% for record in record_set.records %}
|
||||
<ResourceRecord>
|
||||
|
|
@ -150,6 +158,7 @@ class RecordSet(BaseModel):
|
|||
</ResourceRecord>
|
||||
{% endfor %}
|
||||
</ResourceRecords>
|
||||
{% endif %}
|
||||
{% if record_set.health_check %}
|
||||
<HealthCheckId>{{ record_set.health_check }}</HealthCheckId>
|
||||
{% endif %}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue