Amazon is printing money with AWS, and using that money to continue running the retailing side of the house at a loss.
There is a limit though. There's only so much compute and storage required at current prices.
They are picking up enterprise customers left and right. The strategy there is easy.. just go up the stack and peddle solutions built on AWS. Oracle makes billions selling crap the customer never install, much less use.
The grocery business is a huge push that will require much broader capital investments over a huge geographic footprint. They will be back to losing money soon enough.