'Updates Route53 Records following GW domain creation'

def update_route53_records(self, domain_name, dns_name):

    zone_id = self.get_hosted_zone_id_for_domain(domain_name)
    is_apex = (self.route53.get_hosted_zone(Id=zone_id)['HostedZone']['Name'][:(-1)] == domain_name)
    if is_apex:
        record_set = {'Name': domain_name, 'Type': 'A', 'AliasTarget': {'HostedZoneId': 'Z2FDTNDATAQYW2', 'DNSName': dns_name, 'EvaluateTargetHealth': False}}
    else:
        record_set = {'Name': domain_name, 'Type': 'CNAME', 'ResourceRecords': [{'Value': dns_name}], 'TTL': 60}
    response = self.route53.change_resource_record_sets(HostedZoneId=zone_id, ChangeBatch={'Changes': [{'Action': 'UPSERT', 'ResourceRecordSet': record_set}]})
    return response
