Shares of Amazon (NASDAQ: AMZN)surged 50% over the past 12 months to historic highs north of $950 per share. Analysts have been gradually hiking their price targets on the stock, with the highest estimate now reaching $1,250 per share.

Continue Reading Below

But after witnessing Amazon's 300% rally over the past five years, investors might be wondering if it's wise to buy the tech giant at historic highs. I believe that the answer is a definitive "yes" for four simple reasons.

Image source: Amazon.

1. AWS and earnings growth

Throughout much of its history, Amazon's earnings growth was inconsistent. But that all changed with the growth of AWS (Amazon Web Services), the largest cloud infrastructure platform in the world, over the past few years. Customers use AWS for cloud storage, analytics, and software development purposes.

AWS was initially the backbone of Amazon's own e-commerce site, but the company subsequently loaned out that cloud-based computing power to big third-party customers like Netflix, NASA, and the CDC. AWS is a much higher-margin business than Amazon's core marketplace business.

That's why AWS' revenue accounted for a whopping 89% ofits operating income last quarter, despite generating just 10% of the company's revenue. The unit's operating income rose 47% annually to $890 million, and its revenue grew 43% to $3.67 billion. That gives the platform an annual run rate ofalmost $15 billion -- putting it far ahead of competing platforms like Microsoft's Azure.

2. The growth of its Prime ecosystem

AWS' growing bottom line enables Amazon to grow its lower-margin marketplace business with ambitious loss-leading plays like Echo, Dash buttons, original video content, same-day deliveries, and brick-and-mortar stores.

Amazon's Echo smart speaker. Image source: Amazon.

It also enables Amazon to continue expanding overseas at a loss. That's why its international marketplace's operating loss of $481 million (compared to a $121 million loss a year earlier) didn't raise any eyebrows last quarter.

All these moves will allow Amazon to expand its Prime ecosystem, which locks in customers with discounts, free shipping, free videos, e-books, and other perks.

Research firm CIRP recently claimed that Amazon had 80 million Prime members in the U.S. at the end of the first quarter -- a 38% jump from the prior year quarter. It also reported that 85% of Prime members renew their memberships, with the average Prime member spending $1,300 per year, compared tojust $600 for non-members.

3. Its ability to disrupt other markets

Amazon has been expanding in so many directions that it's tough to keep track of all its new initiatives. It's putting pressure on Netflix andYouTube with original shows and niche streaming content (like Twitch), it's challenging restaurant delivery leaders like GrubHub, it's disrupting apparel makers with private apparel brands, and it's striking superstores and grocers with same-day delivery services.

Simply put, Amazon wants to be the one-stop store for everything, and it wants to make that experience as seamless as possible. Those efforts could ensure that the North American and International marketplaces -- which respectively posted 24% and 16% annual sales growth last quarter -- will continue posting double-digit growth.

4. It still isn't expensive relative to its growth potential

Many investors shun Amazon because they think it's an "expensive" stock. At $950, Amazon trades at 194 times last year's earnings and 130 times this year's earnings -- which initially seem lofty relative to its industry average of 40. However, those premiums might be justified by its projected earnings growth rates of 49% this year and 74% next year, which reflect the continued growth of AWS and expanding margins in its international marketplace.

Furthermore, growth stocks like Amazon are often measured by their free cash flow (FCF), which can be reinvested back into their business, instead of their earnings per share. Amazon's trailing-12-month FCF rose 52% to $10.2 billion last quarter, which gives it plenty of capital to expand its cloud and e-commerce businesses.

If we compare Amazon's price growth to its EV/FCF ratio over the past three years, we'll also note that the stock has actually gotten cheaper relative to its FCF as its price surged more than 210%.

Source:YCharts

The verdict: Amazon is still headed higher

The scale of Amazon's cloud platform and e-commerce businesses make it a tough act for anyone -- including tech giants like Microsoft and Alphabet -- to properly follow.

Amazon's dominance of these markets will make it the top one-stop shop for both cloud and shopping needs for the foreseeable future. Those qualities, in my opinion, make Amazon a must-own stock for any investor's long-term portfolio.

10 stocks we like better than AmazonWhen investing geniuses David and Tom Gardner have a stock tip, it can pay to listen. After all, the newsletter they have run for over a decade, Motley Fool Stock Advisor, has tripled the market.*

David and Tom just revealed what they believe are the 10 best stocks for investors to buy right now... and Amazon wasn't one of them! That's right -- they think these 10 stocks are even better buys.

Click here to learn about these picks!

*Stock Advisor returns as of April 3, 2017

Suzanne Frey, an executive at Alphabet, is a member of The Motley Fool's board of directors. Teresa Kersten is an employee of LinkedIn and is a member of The Motley Fool's board of directors. LinkedIn is owned by Microsoft. Leo Sun owns shares of Amazon. The Motley Fool owns shares of and recommends Alphabet (A shares), Alphabet (C shares), Amazon, and Netflix. The Motley Fool has a disclosure policy.