Amazon (AMZN 1.45%) isn't my favorite e-commerce stock (I prefer Shopify's mission to put the power of commerce back in the hands of smaller merchants). Nevertheless, I've been buying Amazon because I think it's too cheap to ignore -- especially when considering the company's main breadwinner, public cloud computing pioneer AWS (Amazon Web Services).

After yet another dip for the stock in the last month or so, I recently went shopping for Amazon stock again, because I think the e-commerce segment is essentially a "freebie" at this point. Here's why Amazon is a top stock to buy for the long term right now.

Valuing different business segments can be hard

As has always been the case with giant and complex businesses, Wall Street has a difficult time getting a handle on how to value Amazon. It's a particularly hard case due to how the company attributes its revenue and operating income (or in the case of 2022, operating losses -- more on that in a minute). 

Broadly speaking, sales and operating profit are broken down into "North America" and "International" (which are further segmented into online and physical store sales, third-party seller services, advertising, and subscriptions), and also "AWS." 

The problem is these operating segments couldn't be more different. North America and International are largely consumer-facing e-commerce businesses, with some lucrative services like digital ads riding sidecar. As impressive as these businesses are, Amazon's e-commerce empire doesn't really pay the bills for shareholders these days. That's the job of AWS, the high-tech cloud titan that's still booming and ridiculously profitable. 

Amazon Segment

Trailing 12-Month Revenue Q2 2022

Trailing 12-Month Revenue Q2 2021

YoY Change

North America

$291.6 billion

$266.6 billion

9.4%

International

$122.2 billion

$124.0 billion

(1.4%)

AWS

$72.1 billion

$52.7 billion

36.9%

Total

$485.9 billion

$443.3 billion

9.6%

Data source: Amazon. 

Amazon Segment

Trailing 12-Month Operating Income (Loss) Q2 2022

Trailing 12-Month Operating Income (Loss) Q2 2021

YoY Change

North America

($1.5 billion)

$11.8 billion

N/A

International

($5.6 billion)

$2.4 billion

N/A

AWS

$22.4 billon

$15.5 billion

45.0%

Total

$15.3 billion

$29.6 billion

(48.4%)

Data source: Amazon. 

In the first half of 2021, AWS generated over half of Amazon's overall operating profit, even though it accounted for just 12% of total revenue. Things have changed dramatically this year as e-commerce has slowed, and Amazon has begun investing heavily to promote its next run of growth. Thanks to continued rapid growth in AWS, the cloud segment now makes up nearly 15% of revenue and is the only segment generating positive operating income.

Nevertheless, operating profit overall has been cut in half over the last year because of North America and International slipping back into the red. The market seems to be following this headline number and has punished Amazon stock accordingly, while overlooking the fast-and-steady advance of AWS. Shares are down over 40% from their all-time high as of this writing. 

Buy one AWS, get an e-commerce empire free

After enduring market punishment, Amazon has an enterprise value of $1.14 trillion. But here's where things get interesting: If AWS were a stand-alone stock right now and still valued at $1.14 trillion, it would currently trade for 51 times trailing 12-month operating profit (based on AWS operating income of $22.4 billion). An expensive price tag? Sure. But not an unthinkable one considering this is a massive computing technologist that still grew its operating income at a 45% pace over the last year. Quality generally fetches a premium. 

What seems off to me is the current valuation seems overly focused on operating losses in the North America and International e-commerce segments. Sure, as stand-alone e-commerce businesses, they are no AWS. Even in mid-2021 when e-commerce was still going full-force during the pandemic, North America and International generated trailing 12-month operating income margins of just 4.4% and 1.9%, respectively (compared to an operating margin of 29.4% for AWS). Nevertheless, even at these slim margins, Amazon's e-commerce (and related services) juggernaut can generate significant cash given the hundreds of billions in sales it does every year.

What I'm saying here is that AWS is the workhorse that's driving Amazon's financials, but Wall Street seems hyperfocused on the e-commerce segments that have temporarily fallen into loss-generating territory. If you believe the e-commerce segments' red ink will be temporary, this stock looks mighty cheap. That's especially true if AWS continues to grow and churn out a high level of profits along the way. Buy the stock now for the cloud computing business, and get Amazon's e-commerce ecosystem as a "free" bonus.