Amazon (AMZN 0.45%) stands as one of the most incredible success stories in stock market history. The company's share price is up more than 15,100% over the past two decades, and the tech giant commands strong positions in highly influential industries. Just this week, it announced plans to acquire healthcare company One Medical for $3.9 billion. On the other hand, its business has been facing challenges lately, and the stock has fallen roughly 30% so far this year as investors have become more cautious about growth stocks.

If you're wondering whether now is the right time to buy, check out these bull and bear takes from two Motley Fool contributors to help inform your decision. 

Bull case

Keith Noonan: Between its e-commerce and cloud-infrastructure businesses, Amazon has spearheaded and continues to dominate industries that have shaped the world. More importantly for investors thinking about buying the stock today, the company's competitive position in these categories remains incredibly strong despite recent headwinds weighing on its valuation. 

In addition to inflation, rising interest rates, and economic uncertainty scaring investors out of growth stocks, Amazon's biggest sales driver (e-commerce) has been putting up performance that's underwhelming investors. Facing challenging comparisons to periods when the earlier days of the pandemic powered online sales, revenue from the company's online-retail-focused segment declined 1.8% year over year in the first quarter.

Making matters worse, this performance is coinciding with massive spending to improve the business's infrastructure and technology resources, and that's resulting in a major drag on the company's overall earnings. 

On the other hand, the big investment will make Amazon's competitive position in e-commerce even stronger, and its cloud infrastructure unit has continued to grow at an impressive clip. That unit, Amazon Web Services (AWS), grew sales 37% year over year in the first quarter and posted a roughly 35% operating income margin. With e-commerce being a relatively low-margin business, AWS accounts for most of the company's profit, and overall margins should improve over the long term as the segment comes to account for a greater portion of overall revenue.

I also expect the online retail business to eventually return to solid growth, and current spending pressures won't last forever. Amazon is facing challenging comparisons as it laps periods when stay-at-home conditions drove elevated sales, but there's plenty of room for growth. E-commerce accounted for just 14.3% of overall retails sales in this year's first quarter, and there's a good chance that spending will continue to shift toward online channels.

Amazon's technology, infrastructure advantages, and logistics advantages also position the company to effectively move into new product and service categories. The recently announced acquisition of One Medical should accelerate the company's push into the healthcare space, and it could also complement the existing Amazon Pharmacy business and bolster the Prime ecosystem. 

With Amazon's stock trading down roughly 40% from its all-time high, investors have an opportunity to build a discounted position in a great company that will play an expanding role in people's lives. 

Bear case 

Parkev Tatevosian: I think Amazon is an excellent company and one worth investing in. However, if there is a bear case to be made, it will focus on the faltering online sales business.

While online sales fell in the first quarter, fulfillment expenses rose by 14% despite no change in units shipped. Slowing sales, rising costs, and overall thin profit margins make the segment less desirable to investors who would rather have the e-commerce giant divert investment into other categories.

Indeed, Amazon's North America and international segments, which include its online sales,  have reported operating income losses for two consecutive quarters. Meanwhile, AWS reported operating income of $5.2 billion and $6.5 billion in its previous two quarters.

Some bears would argue Amazon is spending money on building its logistic networks for a segment with questionable long-term profit margin prospects. These prospects are further damaged by surging inflation, which makes it more expensive for Amazon to offer free shipping to its hundreds of millions of Prime members. If there's a bone to pick with Amazon's excellent business, it has to include this factor. Amazon's plans to pay $3.9 billion to buy One Medical is an excellent example of how management can allocate capital to business opportunities with more significant profit potential.

Is Amazon stock a buy?

If you're not willing to embrace the potential volatility inherent in growth stocks, Amazon stock probably isn't a good fit for your portfolio. On the other hand, the company has some good competitive strengths and appealing growth opportunities, and it should be able to ride out the wave of macroeconomic pressures and elevated infrastructure spending.  For long-term investors seeking exposure to the e-commerce and cloud services markets, Amazon could be a worthwhile buy on recent valuation weakness, but investors should keep the associated risks in mind, including the pessimism around online sales noted above.