I think the ensure_resource function would be in stdlib