def _field_set_recursively(resource, field_name, value):
    """Set a field for a given resource and all of its children.

    Args:
        resource (ResourceData): the resource to change.
        field_name (str): the field to set.
        value (str): the value of the field to set to.

    Returns:
        list. all the effected resources.
    """
    effected_resources = []
    for sub_resource in resource.leaf.get_sub_resources():
        set_resources = _field_set_recursively(sub_resource,
                                               field_name,
                                               value)
        effected_resources.extend(set_resources)

    setattr(resource, field_name, value)
    resource.save()

    effected_resources.append(resource.name)
    return effected_resources