It didn't take long for Google's biggest cloud customer to split its allegiances. Just a week after Snap (SNAP -4.70%) announced it signed a $2 billion five-year contract with the Alphabet (GOOG -1.80%) (GOOGL -1.82%) company, it signed a $1 billion contract with Google's biggest cloud competitor -- Amazon (AMZN -1.35%).

Snap will continue to use Google Cloud for the core Snapchat functionality. The Amazon Web Services contract is for "redundant infrastructure support of our business operations," according to Snap's amended S-1 filing.

The new filing also revealed Snap has been using Amazon for nearly a year, so not much will change in the near term. But the way Snap's contract is structured with Amazon, it could be spending nearly as much on AWS five years from now as it is on Google Cloud.

Woman wearing Snap's Spectacles.

It's worth taking a closer look at Snap's cloud contracts. Image Source: Snap.

A quick look at Snap's cloud contracts

Year

Amazon spending

Google spending

2017

$50 million

$400 million*

2018

$125 million

$400 million*

2019

$200 million

$400 million*

2020

$275 million

$400 million*

2021

$350 million

$400 million

Source: Snap S-1. *Snap has the option to defer up to 15% of the amount to the subsequent year.

Snap uses Google for most of its heavy lifting today. That might change in five years. While Amazon just provides redundancy for Snapchat to ensure the app doesn't suffer significant downtime right now, it could grow into a much bigger partner for Snap. That's evident by the ramp in minimum obligations.

Google still has a big advantage over Amazon. Snap built Snapchat on Google's Cloud Platform. Transition to another cloud provider "would be difficult to implement, and may cause us to incur significant time and expense," it said in its S-1. What's more, Snap built Snapchat using the tools available on Google," some of which do not have an alternative in the market," according to its prospectus.

But if Snap wants to expand to China, where Google doesn't operate, it'll have to rework things on another cloud provider, anyway. Considering the growing size of Snap's cloud spending, Amazon may be able to offer tools comparable to what it uses on Google to help facilitate a transition.

Google's cloud business is minuscule in comparison to Amazon's. Snap's $400 million per year contract very likely made it Google's biggest cloud customer, and now Amazon's going to steal away a good chunk of its business. That doesn't mean much for Amazon -- its cloud business brought in $12 billion last year -- but it means a whole lot to Google.

What this means for Snap

Snap is now committing $3 billion to cloud services over the next five years. That's a lot for a company with only $405 million in annual revenue, even one growing as quickly as Snap.

At some point, it would make more sense for Snap to build out its own infrastructure like other popular internet services. Building infrastructure is capital intensive, but once it's built, the company would no longer be as reliant on third parties to support its flagship app. With Snap locked into contracts for the next five years, it's unlikely we'll see it go that way anytime soon, which means continued pressure on its gross margin.

Last year, Snap's cost of revenue exceeded sales. The bulk of its cost of revenue was attributed to its cloud infrastructure expenses, which climbed $192 million last year. As such, Snap posted a negative gross margin, which is crazy for a company that primarily produces software.

By 2021, Snap will be paying at least $750 million for cloud services. That will make it one of the largest cloud-computing customers in the world. With that much committed to Google and Amazon, Snap better get to work on growing its revenue.