Coming from a stronger AWS background, I decided to stop comparing cloud providers from documentation and instead build something end-to-end on Google Cloud Platform.
The objective was simple:
Build a secure serverless architecture using:
Terraform
Cloud Run
Cloud Armor
Global Load Balancer
Cloud Logging
Cloud Monitoring
The actual experience turned out to be much more interesting than I expected.
The Original Plan
My initial architecture looked like this:
Internet --> Global Load Balancer -->Cloud Run
Simple Deploy infrastructure.
Validate connectivity.
Write a blog.
Done.
That lasted about 30 minutes.
First Reality Check: Cloud Run Isn't AWS Lambda
One mistake I made initially was trying to think in AWS patterns.
In AWS, my instinct would be:
CloudFront │ WAF │ ALB │ Lambda
Enter fullscreen mode
Exit fullscreen mode
GCP approaches this differently.
To place Cloud Run behind a load balancer, I had to learn about:
Serverless Network Endpoint Groups (NEG)
Enter fullscreen mode
Exit…