def get_load_balancer_arn_from_endpoint(endpoint_name, **kwargs):
    """
    Get a load balancer ARN from an endpoint.
    :param endpoint_name:
    :return:
    """
    try:
        client = kwargs.pop("client")
        elbs = client.describe_load_balancers(Names=[endpoint_name])
        if "LoadBalancers" in elbs and elbs["LoadBalancers"]:
            return elbs["LoadBalancers"][0]["LoadBalancerArn"]

    except Exception as e:  # noqa
        metrics.send(
            "get_load_balancer_arn_from_endpoint",
            "counter",
            1,
            metric_tags={
                "error": str(e),
                "endpoint_name": endpoint_name,
            },
        )
        capture_exception(
            extra={
                "endpoint_name": str(endpoint_name),
            }
        )
        raise

    Get a load balancer ARN from an endpoint.
    :param endpoint_name:
    :return:
    
lemur/plugins/lemur_aws/elb.py