After a challenging year, Amazon's (AMZN -1.65%) stock is down 41% year over year, experiencing steep declines in its e-commerce business in 2022. But the company has started the new year with a bang: Its stock has risen 14% since Jan. 1.

Investors have begun to rally over signs inflation could be easing, and Amazon is expanding its Buy With Prime program, which could provide long-term revenue boosts. 

The company has leading market shares in two lucrative industries, making its stock seem like a no-brainer investment. However, significant hits to its business over the past 12 months make the decision to invest in Amazon more complex. 

Here's one green flag for Amazon in 2023 and one red flag.

Green flag: Amazon Web Services

The biggest reason to invest in Amazon is its leading position in the booming cloud computing industry. Amazon Web Services (AWS) provides cloud services to millions of consumers from data centers worldwide. It is a cash cow for Amazon.

In the third quarter of 2022, AWS held a leading 34% market share in cloud computing, allowing it to profit considerably from the market's swift growth.

According to Grand View Research, the cloud computing market, which was worth $369 billion in 2021, will have compound annual growth of 15.7% through 2030.

The company is enjoying quarterly substantial revenue gains from this burgeoning market, with its AWS segment rising 27% to $20.5 billion in the third quarter of 2022. The cloud computing business also made up 100% of Amazon's operating income, keeping the company growing despite e-commerce declines. 

Cloud computing has a long future, with plenty of room to grow. AWS has competing platforms from Microsoft and Alphabet nipping at its heels, but the service has a good lead for the most market share in the industry, with no plans to stop expanding. 

Red flag: E-commerce declines alongside a looming recession 

Although Amazon's growth in cloud computing is promising for its long-term future, 85% of its revenue still came from its e-commerce business in the third quarter 2022. As a result, a looming recession is concerning for this already-bleeding segment.

Between Amazon's North American and international divisions, its operating losses amounted to $2.87 billion in its most recent quarter. The company has responded to losses with a slew of cost-cutting measures such as canceling or closing dozens of warehouses, sunsetting its Amazon Care telehealth service, and plans to cut 18,000 jobs. 

But Amazon's performance amid macroeconomic headwinds in 2022 is concerning compared to its competitors, suggesting its reliance on e-commerce leaves it more vulnerable than most. The company reported negative $26.3 billion in free cash flow as of Sept. 30.

Meanwhile, its peers in the tech world faced similar economic challenges throughout the year but seemed to fare better. In the same period, Microsoft reported $63.33 billion in free cash flow, Alphabet $62.5 billion, and Netflix $717 million.

However, it's not all bad news for Amazon's e-commerce business. Investors pumped up its shares this week after the company announced an expansion of its Buy With Prime program, which allows all eligible merchants to offer Prime services such as free delivery and returns on their own sites. If successful, Amazon could receive a significant boost in revenue for years, with the ability to earn from nearly any online retailer. 

Despite Amazon's stock being down so much in the last 12 months, its shares are still trading at almost 90 times earnings. The company is definitely one to keep on your radar to strike at the right time because it has a promising long-term outlook. However, its stock still seems overpriced compared with other more-attractive companies.