Ab initio effective interactions for sd-shell valence nucleons