Amazon's (AMZN 0.83%) share prices have surged by over 11.6% in response to the company's stellar second-quarter results (ended June 30). Now, the stock is down by 14.4% so far this year.

Investors and analysts have become impressed with the technology titan's execution capability. Let's review the three reasons why long-term investors can consider this stock as a great buying opportunity now.

AWS remains the undisputed crown jewel

Amazon has long been known for its e-commerce business and broad fulfillment network. However, industry-leading cloud infrastructure services business Amazon Web Services (AWS) has become the key growth driver. Despite the surging inflation and technical recession (two consecutive quarters of decline in gross domestic product) in the U.S., global enterprise spending on cloud infrastructure services grew year over year by 29% to $55 billion in the second calendar quarter. Management believes this is only the early stage of cloud adoption in the enterprise and public sector space and expects demand for cloud infrastructure to increase further in the coming quarters.

AWS accounted for 34% share of this global market in the second quarter, up sequentially by 1 percentage point. This cloud business raked in revenue of $19.7 billion, up year over year by 33%. Despite the impact of the increase in employee stock-based compensation expense due to rising wage inflation, AWS's operating margin rose year over year by 0.7 percentage points to 29%. AWS also reported a 65% year-over-year jump in backlog, which implies AWS will have a solid project pipeline for future quarters.

AWS is undoubtedly the most valuable business for Amazon, considering that it contributed only 16.28% to the company's top line, but accounted for almost all of its operating income. The company is focusing on investing in its sales force and infrastructure capacity expansions for AWS in new geographies. While this is expected to result in margin contraction for AWS in coming quarters, it will increase Amazon's revenue and margin exposure to the highly profitable AWS business in the long run.

The advertising business is gaining momentum

Amazon has been quite successful in targeted digital advertising since it is not only promoting products and services to people with high purchase intent but also at the point of purchase. The effectiveness and measurability of Amazon's ads have become even more relevant against the backdrop of Apple's privacy changes. In the second quarter, the company's advertising revenue was up 18% year over year to $8.8 billion.

The e-commerce business is showing strength

Despite a consumer slowdown, Amazon's e-commerce business has shown signs of strength. According to Insider Intelligence, Amazon accounts for 37.8% of the U.S. e-commerce business, a market estimated to be worth over $1 trillion in 2022.

Amazon has been working to reduce its labor costs and excess warehouse capacity, which resulted in over $6 billion of additional costs in the first quarter. These costs came down to $4 billion in the second quarter as the company focused on reducing headcount and improving its fulfillment network's productivity.

Despite macroeconomic tensions, Amazon managed to host its most successful Prime Day ever in July 2022. While a record Prime Day will not have a huge impact on the financials of this behemoth, it is expected to bring in more Amazon Prime subscription members (a recurring revenue source) in the coming quarters. In addition, the deal with Grubhub, which allows Prime members a free one-year membership to Grubhub+ service for free restaurant delivery, can also help expand the Prime member base.

Is Amazon a good investment?

In the second quarter, Amazon's revenue was up year over year by 7% to $121.2 billion, ahead of the company's revenue guidance as well as consensus estimates. While this single-digit growth pales in comparison to the company's historical double-digit top-line growth, it highlights the resilience of the company's business model in the current precarious economic environment. Amazon's operating income was down 57% year over year to $3.3 billion, significantly higher than the company's guidance range, which stretched from an operating loss of $1 billion to operating income of $3 billion.

Amazon is valued at 58.5 times forward earnings, the lowest the company has traded since January 2021. The reduced price point makes the stock even more attractive for retail investors.

However, it is not all sunshine and roses for Amazon. Although revenue has grown consistently, the company reported negative free cash flow of $23.5 billion in the last 12 months ending the second quarter. The company's over-dependence on AWS for profitability also exposes the company to business concentration risk.

Despite these risks, against the backdrop of a high-flying AWS business, resilient e-commerce business, and strengthening advertising business, Amazon can prove to be a solid buy-and-hold pick for long-term retail investors.