Right - the hardware is already built. PHY, chipset, host CPU/disk/RAM, etc. It really comes down to the whitebox being selected. Facebook does do some hardware design, but it's more of chaining multiple merchant silicon chipsets together or building modular boxes that can house multiple chipsets.
Control-plane/management-plane software is often written by these companies or by contractors.
NICs are another story. MSFT and AMZN both build their own NICs using either FPGAs or custom silicon.