Chelsea Jia Feng/BIAmazon's cash balance is expected to hit almost $400 billion by 2027, far outpacing its tech rivals.This cash gusher stems from record profits, cost cutting, and success in cloud and advertising.Shareholders will want some of this money. So far, Amazon is investing in AI and other growth plans.Amazon's ballooning cash balance is drawing Wall Street's attention.The company is on pace to have $127.4 billion in cash and short-term investments by the end of this year, tripling the amount from 2018 and surpassing $100 billion for the first time, according to consensus estimates compiled by S&P Global Market Intelligence.That would give Amazon more money than its rivals Alphabet and Microsoft, each expected to have about $112.8 billion and $108.1 billion in cash by that time, respectively.