def METHOD_NAME(ruleset, region_name):
    wlm_config = None
    if CONFIG_KEY in ruleset and isinstance(ruleset[CONFIG_KEY], list):
        wlm_config = json.dumps(ruleset[CONFIG_KEY])
    elif CONFIG_KEY in ruleset and isinstance(ruleset[CONFIG_KEY], basestring):
        if ruleset[CONFIG_KEY].startswith('s3://'):
            wlm_config = json.dumps(get_file_contents(ruleset[CONFIG_KEY], region_name))
    else:
        raise Exception(
            "Malformed Configuration for Ruleset %s. '%s' must be a json based WLM configuration or an S3 file location" % (
            ruleset[RULESET_NAME_KEY], CONFIG_KEY))
    return wlm_config