In fact both of them, actually Amazon too, invest in their own inference hardware and owns the stack.
You can't possibly think that these companies will keep shelling 50-100B per year in hardware alone where 60%+ is margin for Nvidia and not invest there.