Amazon's (AMZN 0.80%) accomplishments in retailing and cloud computing have made it one of the most successful consumer discretionary stocks in history. At a market cap approaching $1.6 trillion, it lags behind only Apple (AAPL 1.00%) and Microsoft (MSFT 0.43%) in this financial measure.

Of course, the economy has changed significantly since the COVID-19 pandemic began. The mass shutdowns led to a 33% contraction in the gross domestic product in the second quarter. Such downturns often lead to a significant loss in business for retailers such as Amazon.

Nonetheless, Amazon stock continues to log new record highs. Amazon may offer some measure of recession resistance. Still, examining whether one should call the company "recession-proof" involves looking at how much influence the pandemic has actually wielded over the company's performance.

AMZN Chart

AMZN data by YCharts

Amazon's retail business

Amazon has become best-known to consumers for pioneering and then domineering the e-commerce front. At one point, Amazon stoked fears of a "retail takeover," and companies such as Walmart (WMT 0.58%) and Costco (COST 2.05%) suffered for a time. Although these two companies and other large retailers have found ways to stay competitive, Amazon remains influential.

In the second quarter, Amazon brought in domestic and international net sales of more than $78.1 billion combined. That is an increase of nearly 42% year over year. It is also more than double the growth rate reported in the second quarter of 2019.

Admittedly, the pandemic likely played a significant role in this sales increase. Since fear of COVID-19 has led to fewer outings for most people, Amazon has become a natural destination for shoppers staying home. On the earnings call, CFO Brian Olsavsky cited "strong early demand" for consumables to explain the increase. Olsavsky also singled out online grocery sales, which tripled year over year.

Happy couple making an online payment on their laptop.

Image source: Getty Images

Amazon Web Services and the current economy

Still, for all of the focus on retail, Amazon Web Services (AWS) is arguably the jewel of the company. Amazon led the way in cloud computing when it started AWS in 2006. The cloud spawned a new niche sector in the technology industry.

This has helped Amazon maintain its market lead. According to Canalys, Amazon accounted for more than 32% of cloud infrastructure spending in 2019. This is nearly double the market share of its largest competitor in this space, Microsoft Azure.

AWS has long made up the majority of the company's profits. The operating income of AWS in the second quarter -- just under $3.36 billion -- was about 57% of the operating income earned by the company overall. Second-quarter net sales of just over $10.8 billion only make up a small fraction of the retail net sales figures. Nonetheless, this is an increase of almost 29% from year-ago levels.

COVID-19 also appears to have hastened growth. As more workers leave the office in favor of safer work-from-home options, cloud computing has only become more essential amid the pandemic.

Is Amazon recession-proof or just pandemic-proof?

Indeed, Amazon should have a profitable future. However, much of its current growth relates to the nature of the coronavirus downturn rather than the recession it has sparked. On the retail side, a recession unrelated to a pandemic would not have necessarily driven more shoppers online. Moreover, it likely would not have shifted more work to the cloud.

For these reasons, the next recession has the definite potential to affect Amazon negatively. But keep in mind that, despite the severity of this downturn, a 33% reduction in GDP means that 67% of the economic activity remains.

On the retail side, Amazon sells the consumer staples that will remain in demand regardless of the overall economy. Also, since AWS provides infrastructure services, it will remain the backbone of parts of the tech industry in both good times and bad.

In the end, the company should remain recession-proof long term. Nonetheless, investors should probably temper performance expectations in future downturns.