code: def find_existing_record(env, zone_id, dns_name, check_key=None, check_value=None):
      
      client = boto3.Session(profile_name=env).client('route53')
      pager = client.get_paginator('list_resource_record_sets')
      existingrecord = None
      for rset in pager.paginate(HostedZoneId=zone_id):
          for record in rset['ResourceRecordSets']:
              if check_key:
                  if record['Name'].rstrip('.') == dns_name and record.get(check_key) == check_value:
                      LOG.info("Found existing record: %s", record)
                      existingrecord = record
                      break
      return existingrecord
docs: Check if a specific DNS record exists.
  
      Args:
          env (str): Deployment environment.
          zone_id (str): Route53 zone id.
          dns_name (str): FQDN of application's dns entry to add/update.
          check_key(str): Key to look for in record. Example: "Type"
          check_value(str): Value to look for with check_key. Example: "CNAME"
  
      Returns:
          json: Found Record. Returns None if no record found