Eat, Pray, Terraform - AWS to GCP Migration
Eat, Pray, Terraform: AWS to GCP Migration
Motivation
I’ve used AWS as my primary cloud provider for over 8 years. I used to recommend it to all my clients whenever they needed a simple and reliable solution. But ever since AI came into our lives, AWS decided it’s a brilliant idea to shove it everywhere 1 2 3 4 5.
The AWS Console has gotten noticeably worse - you often have to wait 5 to 10 seconds just for basic service pages to load. Instead of getting actual support, you’re forced to deal with an unhelpful AI chatbot with no quick way to reach an actual human 6. And, of course, prices keep going up 7.
After years of sticking with AWS, I finally took the plunge and migrated to GCP (and let’s be honest, Azure was never an option - I’m just a hater of Microsoft products).
I won’t turn this post into an architectural debate or a deep dive into GCP’s feature set. Instead, I want to keep things strictly practical: this is a simple guide on how to migrate your Terraform resources from AWS to GCP.
Just to be clear: this isn’t a sponsored post, and I’m definitely not a GCP fanboy. Google Cloud has its own fair share of flaws, weird quirks, and questionable decisions. I don’t think it’s a perfect provider by any means - it’s simply turned out to be the lesser of two evils for me right now.
Prerequisites
Before we start refactoring Terraform code, make sure your local setup is ready to talk to Google Cloud. Nothing exotic here—just the standard tooling:
Run gcloud init to initialize the gcloud CLI:
gcloud init
Terraform must authenticate to Google Cloud to create infrastructure:
gcloud auth application-default login
You can also find useful information in the official guides; I recommend checking them out:
Networking
The biggest mental leap when moving from AWS to GCP is that AWS VPCs are regional, while GCP VPCs are global by default.