def METHOD_NAME(cls, data, ref_params):
    """
    Return new AWSKMSSecret from data and ref_params: target_name
    key will be grabbed from the inventory via target_name
    """
    try:
        target_name = ref_params.kwargs["target_name"]
        if target_name is None:
            raise ValueError("target_name not set")
        target_inv = cached.inv["nodes"].get(target_name, None)
        if target_inv is None:
            raise ValueError("target_inv not set")
        key = target_inv["parameters"]["kapitan"]["secrets"]["awskms"]["key"]
        return cls(data, key, **ref_params.kwargs)
    except KeyError:
        raise RefError("Could not create AWSKMSSecret: target_name missing")