change resource function's name to resource_for_each_with_name