from typing import Dict


def get_health_check_endpoint_for_instance(instance: Dict[str, str], groups: Dict[str, Dict[str, str]]) -> str:
    """
    Returns the endpoint that should be used for health checks

    :param instance: instance to look up
    :param groups: configuration dict
    :return: endpoint to use for health checks
    """
    return groups[instance["AutoScalingGroupName"]]["health_check_endpoint"]