def attach_certificate_v2(listener_arn, port, certificates, **kwargs):
    """
    Attaches a certificate to a listener, throws exception
    if certificate specified does not exist in a particular account.

    :param listener_arn:
    :param port:
    :param certificates:
    """
    try:
        needs_cert_update_for_sni = has_listener_cert_for_sni(listener_arn, kwargs["client"])

        modified_listener = kwargs["client"].modify_listener(
            ListenerArn=listener_arn, Port=port, Certificates=certificates
        )

        if needs_cert_update_for_sni:
            current_app.logger.info(f"Adding cert as listener cert for SNI. listener_arn: {listener_arn}")
            kwargs["client"].add_listener_certificates(
                ListenerArn=listener_arn, Certificates=certificates
            )
        return modified_listener

    except botocore.exceptions.ClientError as e:
        if e.response["Error"]["Code"] == "LoadBalancerNotFound":
            current_app.logger.warning("Loadbalancer does not exist.")
        else:
            raise e

    Attaches a certificate to a listener, throws exception
    if certificate specified does not exist in a particular account.

    :param listener_arn:
    :param port:
    :param certificates:
    
lemur/plugins/lemur_aws/elb.py