Building out warehouses does not hurt earnings. The whole point of accounting is to try to match revenue with cost. If you build a warehouse you don't expense it one time. It gets expensed over time.
If they develop software than that is treated as expense or buy movies that gets expensed.
Their core retail business is not that profitable. It goes from 0-3%. Its pretty much the same as walmart or any other retailer.
AWS is more profitable than their entire retail business.