def retrieve_secret()

in src/retrieveGrafanaSecrets.py [0:0]


def retrieve_secret(secret_arn):
    """
    Get Secret Arn.
    :param secret_arn: the AWS Secret Manager secret ARN
    :return: the secrets as "<username> <password>"
    """

    try:
        response = get_secret_over_ipc(secret_arn)
        secret_json = json.loads(response)
        return "{} {}".format(secret_json["grafana_username"], secret_json["grafana_password"])
    except Exception as e:
        logging.error("Exception while retrieving secret: {}".format(secret_arn), exc_info=True)
        raise e