Amazon AWS is the literal incarnation of "money printer go BRRRR" meme. The profit margins are insane on it. They have zero issues with money reserves to expand to new things.
amazon never had their money run out, they have been incredibly profitable for a long time, they just put it back into the company. Building up patents and technology is the not the same as not showing a profit on your balance sheet.