def upload_cert(name, body, private_key, cert_chain=None, **kwargs):
    """
    Upload a certificate to ACM AWS

    :param body:
    :param private_key:
    :param cert_chain:
    :param path:
    :return:
    """
    assert isinstance(private_key, str)
    client = kwargs.pop("client")

    metrics.send("upload_acm_cert", "counter", 1, metric_tags={"name": name})
    try:
        if cert_chain:
            return client.import_certificate(
                Certificate=str(body),
                PrivateKey=str(private_key),
                CertificateChain=str(cert_chain),
            )
        else:
            return client.import_certificate(
                Certificate=str(body),
                PrivateKey=str(private_key),
            )
    except botocore.exceptions.ClientError as e:
        if e.response["Error"]["Code"] != "EntityAlreadyExists":
            raise e

    Upload a certificate to ACM AWS

    :param body:
    :param private_key:
    :param cert_chain:
    :param path:
    :return:
    
lemur/plugins/lemur_aws/acm.py