def __fetch_route53_zone_records(self, zone_id):
        """Return all resource records for a specific Route53 zone

        Args:
            zone_id (`str`): Name / ID of the hosted zone

        Returns:
            `dict`
        """
        route53 = self.session.client('route53')

        done = False
        nextName = nextType = None
        records = {}

        try:
            while not done:
                if nextName and nextType:
                    response = route53.list_resource_record_sets(
                        HostedZoneId=zone_id,
                        StartRecordName=nextName,
                        StartRecordType=nextType
                    )
                else:
                    response = route53.list_resource_record_sets(HostedZoneId=zone_id)

                if response['IsTruncated']:
                    nextName = response['NextRecordName']
                    nextType = response['NextRecordType']
                else:
                    done = True

                if 'ResourceRecordSets' in response:
                    for record in response['ResourceRecordSets']:
                        # Cannot make this a list, due to a race-condition in the AWS api that might return the same
                        # record more than once, so we use a dict instead to ensure that if we get duplicate records
                        # we simply just overwrite the one already there with the same info.
                        record_id = self._get_resource_hash(zone_id, record)
                        if 'AliasTarget' in record:
                            value = record['AliasTarget']['DNSName']
                            records[record_id] = {
                                'id': record_id,
                                'name': record['Name'].rstrip('.'),
                                'type': 'ALIAS',
                                'ttl': 0,
                                'value': [value]
                            }
                        else:
                            value = [y['Value'] for y in record['ResourceRecords']]
                            records[record_id] = {
                                'id': record_id,
                                'name': record['Name'].rstrip('.'),
                                'type': record['Type'],
                                'ttl': record['TTL'],
                                'value': value
                            }

            return list(records.values())
        finally:
            del route53
def __fetch_route53_zone_records ( self , zone_id ) : route53 = self . session . client ( 'route53' ) done = False nextName = nextType = None records = { } try : while not done : if nextName and nextType : response = route53 . list_resource_record_sets ( HostedZoneId = zone_id , StartRecordName = nextName , StartRecordType = nextType ) else : response = route53 . list_resource_record_sets ( HostedZoneId = zone_id ) if response [ 'IsTruncated' ] : nextName = response [ 'NextRecordName' ] nextType = response [ 'NextRecordType' ] else : done = True if 'ResourceRecordSets' in response : for record in response [ 'ResourceRecordSets' ] : record_id = self . _get_resource_hash ( zone_id , record ) if 'AliasTarget' in record : value = record [ 'AliasTarget' ] [ 'DNSName' ] records [ record_id ] = { 'id' : record_id , 'name' : record [ 'Name' ] . rstrip ( '.' ) , 'type' : 'ALIAS' , 'ttl' : 0 , 'value' : [ value ] } else : value = [ y [ 'Value' ] for y in record [ 'ResourceRecords' ] ] records [ record_id ] = { 'id' : record_id , 'name' : record [ 'Name' ] . rstrip ( '.' ) , 'type' : record [ 'Type' ] , 'ttl' : record [ 'TTL' ] , 'value' : value } return list ( records . values ( ) ) finally : del route53
Return all resource records for a specific Route53 zone

        Args:
            zone_id (`str`): Name / ID of the hosted zone

        Returns:
            `dict`