Amazon (AMZN 2.94%) stock has made a strong recovery this year after tumbling in 2022. The stock is still well below its pandemic-era high, but it's been moving in the right direction. The company remains the king of e-commerce and cloud computing, although both businesses are facing challenges.

Is it time to buy Amazon stock? There are a few things to consider.

1. The retail business is barely profitable

Most of Amazon's revenue comes from the retail side of the business. The e-commerce giant sells products itself, and it also collects various fees from third-party sellers. Around 59% of all items sold in the first quarter were from Amazon's third-party sellers.

Amazon generated $51.1 billion from selling online products directly in the first quarter, along with another $4.9 billion from its physical stores. Third-party seller services produced another $29.8 billion of revenue, while subscription services like Prime churned up $9.7 billion. Lastly, advertising services generated $9.5 billion in revenue.

While this all adds up to an enormous amount of revenue, profit has been hard to come by as of late. The retail business is split into two reportable segments, North America and International, and neither is particularly profitable. The North America segment eked out a $898 million operating profit on $76.9 billion in sales in the first quarter, while the International segment posted an operating loss of $1.2 billion on $29.1 billion in sales.

These results are an improvement over last year when Amazon was losing money hand over fist as rising inflation put pressure on consumers. The company has been on a cost-cutting crusade, slashing its workforce by 10% over the past year and reviewing money-losing initiatives. Even with those cuts, the retail business isn't contributing much to Amazon's bottom line.

2. AWS is slowing down

Amazon Web Services (AWS) is the company's crown jewel. The cloud computing unit has a 32% share of the cloud infrastructure market, and it's become the standard choice for many large enterprises moving workloads to the cloud.

AWS produced $21.4 billion in revenue and $5.1 billion in operating profit during the first quarter. There's plenty of competition in the cloud computing market, but switching costs are high. An enterprise customer that uses a wide variety of cloud services on AWS to support mission-critical workloads is unlikely to switch providers because of the potential for disruption.

While a customer exodus is highly unlikely, AWS's customers are starting to take a hard look at cloud costs amid a tough economy. Something like 30% of cloud spending is wasted, according to McKinsey. "As expected, customers continue to evaluate ways to optimize their cloud spending in response to these tough economic conditions in the first quarter", said Amazon CFO Brian Olsavsky during the first-quarter earnings call.

AWS revenue grew by just 16% year over year in the first quarter, and operating profit tumbled by 21%. The segment's operating margin came in at 24%, a harsh contraction from an operating margin of 35% in the prior-year period.

The golden age of cloud computing, when companies would move workloads to the cloud without caring all that much about costs, is giving way to a much more cautious environment. For AWS, slower growth and lower profit margins may be the new norm as customers look for ways to slash their cloud bills.

Is Amazon stock a buy?

In my opinion, no. The e-commerce and cloud computing giant is valued at $1.3 trillion, putting the price-to-earnings ratio based on the average analyst estimate for 2023 at nearly 90. Amazon can grow profits as it continues to cut costs, but both the retail and cloud computing businesses are under pressure. It's possible that AWS's margins have peaked, and while the segment will continue to produce outsize profits, it may not be as lucrative as it's been in the past.

Amazon is an incredible business with some major competitive advantages, but given the challenges it's facing, the stock looks way too expensive to me.