EC2 vs Azure VM vs GCP Compute Engine
Three brand names for the same rented machine. Once you see that, the comparison stops being about the products and starts being about where you already live.
New to cloud? CAMPUX is a free, build-first course. Start here →
AWS EC2, Azure Virtual Machines, and GCP Compute Engine all rent you the same thing — a virtual machine you launch from an image, size from a family, wrap in a firewall, and pay for by the second or the hour. For most workloads the price and performance land close enough that the honest deciding factor is ecosystem, not a few cents an hour. Pick the cloud your identity, data, and team already sit in; then spend your energy on right-sizing and the right purchase model, which move the bill far more than the logo does.
I have run production on all three. The first time you move between them the vocabulary feels like a wall — different words, different consoles, a launch wizard that asks the same questions in a different order. Then you notice the wall is made of synonyms. An EC2 instance, an Azure VM, a Compute Engine instance are the same object: some vCPUs, some RAM, a disk, a network card, and a bill that ticks while it runs. Learn the object once and you have learned it three times.
The words are different; the thing is not
Most "vs" articles about these three are really glossaries. They walk you through the fact that AWS says security group and Azure says network security group and act like that is an insight. It is trivia. Useful trivia the first week, worthless by the second. Here it is in one table so you can stop looking it up, and then we can talk about the part that actually costs money.
| Concept | AWS EC2 | Azure | GCP Compute Engine |
|---|---|---|---|
| The machine | Instance | Virtual machine (VM) | Instance |
| The OS template | AMI (Amazon Machine Image) | Image / VM image | Image |
| Host firewall | Security group | Network security group (NSG) | VPC firewall rule |
| Private network | VPC | Virtual network (VNet) | VPC network |
| Attached disk | EBS volume | Managed disk | Persistent disk |
| Sizing unit | Instance type (e.g. m7i.large) | VM size (e.g. D4s v5) | Machine type (e.g. n2-standard-4) |
| Auto-scaling group | Auto Scaling Group | Virtual Machine Scale Set | Managed Instance Group |
| Temporary public identity | Elastic IP | Public IP | External IP |
That is the whole glossary the comparison articles stretch into 2,000 words. Screenshot it if you like. The moment you have built one VM on one cloud — which you can do free in an afternoon on our virtual machines class — this table reads as a rename sheet, not a study guide.
Naming differences are trivia. Right-sizing and the purchase model are the skill.
Sizing families: general, compute, memory, GPU
Every provider slices its VMs into families by what the workload leans on. The letters differ; the shape is identical. You are always choosing between a balanced machine, a CPU-heavy one, a RAM-heavy one, and specialized silicon for GPUs or high storage throughput.
| Workload lean | AWS EC2 | Azure | GCP |
|---|---|---|---|
| General purpose (balanced) | M-series, T-series (burstable) | D-series, B-series (burstable) | N-series, E2 (cost-optimized) |
| Compute optimized | C-series | F-series | C2, C3 |
| Memory optimized | R, X-series | E, M-series | M-series (memory), N2-highmem |
| GPU / accelerated | P, G-series | N-series (NC, ND, NV) | A-series, G2 |
| Own-silicon option | Graviton (Arm) | Cobalt / Ampere Arm sizes | Tau T2A (Arm) |
Two things worth carrying out of this table. First, "burstable" (AWS T, Azure B) is the beginner's friend and the beginner's trap: cheap machines that bank CPU credits when idle and throttle hard when the credits run out. Great for a dev box, quietly awful under a steady load. Second, the Arm-based families — Graviton, Azure's Arm sizes, GCP's Tau — are usually the cheapest way to get the same work done if your software runs on Arm. That single choice beats most provider-shopping.
Pricing: same three models, three names
This is where the real money is, and where I will not quote you a per-hour dollar figure, because any number I print today is wrong by the time you read it. These prices move monthly, they differ by region, and every provider runs a calculator that will give you the current figure for the exact machine and region you care about. Bookmark all three. What does not move is the shape of the pricing models, and understanding the shape is what separates a $900 bill from a $300 one for identical compute.
| Model | AWS EC2 | Azure VM | GCP Compute Engine |
|---|---|---|---|
| Pay-as-you-go (no commitment) | On-Demand | Pay-as-you-go | On-demand |
| Commit 1 or 3 years, save big | Savings Plans / Reserved Instances | Reservations (Reserved VM Instances) | Committed use discounts (CUDs) |
| Interruptible, deep discount | Spot Instances | Spot Virtual Machines | Spot VMs (formerly Preemptible) |
| Automatic loyalty discount | — | — | Sustained use discounts (no commit) |
| Bring-your-own Windows/SQL licence | Licence Mobility | Azure Hybrid Benefit | Sole-tenant / BYOL |
| Billing granularity | Per-second, 60-sec min (Linux) | Per-second, 60-sec min (Linux) | Per-second, 60-sec min |
| Free tier | 750 hrs/mo t2.micro or t3.micro, 12 months | ~$200 / 30-day credit + selected always-free services | e2-micro always-free (1 per month, US regions) + $300 / 90-day credit |
Read that middle row twice. The commitment discount — AWS Savings Plans, Azure Reservations, GCP committed-use discounts — is the single biggest lever on a compute bill. Commit to a baseline of usage for one or three years and you routinely cut the rate by 40 to 70 percent versus on-demand, no engineering change required. The catch is honest: you are betting you will still be running roughly that much a year from now. For steady production, that bet is easy. For a workload you might kill next quarter, stay on-demand.
Spot is the other big lever, in the other direction. All three sell you their spare capacity at a steep discount on the condition that they can take the machine back with a couple of minutes' notice. For a stateless batch job, a CI runner, a render farm — anything that can be interrupted and restarted — spot is close to free money. For your database, it is a way to lose your afternoon.
GCP's sustained-use discounts apply automatically the longer an instance runs within a billing month — no reservation, no paperwork. AWS and Azure have no equivalent freebie; on those two you get the loyalty discount only by committing up front. It is a real difference, but it rarely outweighs where your identity, data, and team already live. Convenience discount, not a reason to migrate.
So which one — honestly
If the machines are near-interchangeable and the pricing models are the same three ideas, the decision cannot be "which VM is best." There isn't a best VM. The decision is which ecosystem you are choosing to be fluent in, because the VM is the boring 10 percent — the identity system, the networking defaults, the managed services you'll wire the VM into, and the team that has to operate it are the other 90 percent.
For most people reading this, that answer is Azure, and not out of loyalty. Azure is where the enterprises are. If you already run Microsoft 365, Entra ID, and on-prem Windows Server, an Azure VM slots into identity and licensing you already own — Azure Hybrid Benefit alone can pay for the move by reusing Windows and SQL licences you're already holding. The job market follows the enterprises: the volume of "cloud engineer" postings that name a specific cloud leans heavily Microsoft, which is the whole reason this bootcamp teaches Azure first and treats AWS and GCP as accents you'll pick up in a week once the concepts are yours.
Pick AWS when the surrounding team already breathes it or you need the widest catalogue of niche services. Pick GCP when you're deep in data and Kubernetes and want those sustained-use discounts and clean networking. But notice none of those reasons is "the VM is cheaper," because at the machine level it basically isn't. The provider is an ecosystem decision. The bill is a right-sizing and purchase-model decision. Keep those two straight and you're already ahead of most people who've held the job for a year.
Not by picking the "wrong" cloud. By leaving a VM running that nobody uses, over-sizing it "to be safe," paying on-demand for a workload that runs 24/7 and should be reserved, and never turning on a budget alert. Every one of those mistakes costs the same on all three clouds. Fix the habit and the logo stops mattering.
Common questions
Is EC2, Azure VM, or Compute Engine cheaper?
For the same amount of vCPU and RAM the on-demand rates land within a few percent of each other, and they move constantly — so no provider is reliably "the cheap one." What changes your bill by 40 to 70 percent is the purchase model: a one- or three-year commitment (AWS Savings Plans, Azure Reservations, GCP committed-use discounts) versus on-demand, and using spot for interruptible work. Right-sizing the VM matters far more than picking the provider.
What is the Azure equivalent of an AWS EC2 instance?
An Azure Virtual Machine. It is the same product: a virtual machine you launch from an image, size from a family, protect with a firewall, and pay for by the second. AWS calls the machine an instance and its firewall a security group; Azure calls them a VM and a network security group. On GCP the same thing is a Compute Engine instance with VPC firewall rules.
Do AWS, Azure, and GCP all bill VMs per second?
Effectively yes, with a floor. AWS EC2, Azure VMs, and GCP Compute Engine all bill by the second for most Linux instances, typically after a one-minute minimum. Windows and some marketplace images can bill per hour. GCP also applies automatic sustained-use discounts the longer an instance runs in a month, with no commitment required.
Is learning one cloud's VMs enough to use the others?
Mostly, yes. The concepts — images, sizing families, disks, firewall rules, reserved versus spot pricing — transfer directly across all three. What does not transfer for free is the surrounding ecosystem: identity, networking defaults, IAM model, and the managed services around the VM. Learn one cloud deeply and the second one is mostly renaming, not relearning.