GCP Cloud Resume Challenge
Hey there, long time no blog! If you're not already familiar, the Cloud Resume Challenge is a popular project-based learning initiative designed to help folks gain practical experience with Amazon Web Services (AWS). I recently took on the challenge and decided to do things a little differently by deploying it in Google Cloud Platform (GCP) instead. In this blog post, I'll share my experience setting up the infrastructure, highlight some of the challenges I encountered, and discuss the lessons I learned along the way. You can read more about the challenge here: https://cloudresumechallenge.dev/
Why I went with this setup
I've worked on some projects using GCP in the past, namely for work, so I felt more comfortable using it for the Cloud Resume Challenge instead of AWS. To make things easier, I also decided to use Terraform to manage the infrastructure as just a way of dipping my toes into GitOps. This way, I could push a change and a GitHub action would kick off to push new html files into the storage bucket without interaction in the repo. It's honestly a great way to keep everything organized and automated with a minimum possible chance of human error. You can read more about GitOps here -- GitLab has a great write up. In fact, that github action was one thing that I did keep for this iteration of my site, anytime I make an update to it it deploys right to firebase!
Setting up the Infrastructure
To get started, I needed to set up a GCP
storage bucket, a load balancer for HTTP and HTTPS, and a Firebase database to store the number of
visitors to the site. I elected to use GCP's Cloud Functions to trigger the increment on the database value. I
also ported my domain name over to Google's Domain service to make attaching the certificates to the load
balancers a bit easier.
To
make things more "interesting" (read:
complicated), I also decided to add in a Cloud Workflow. This would call
the cloud function and act effectively as an API to update the database. While AWS does have their own unique
names for everything when it comes to cloud technology, all of the concepts transferred over to GCP since they
all operate effectively the same way.
It took some time to get everything set up and working correctly, but I was
excited to see it all come together -- once I got to the HTML and CSS portion of the project, the lifelong
skills of having and updating a MySpace blog back in the day really shown.
Dealing with Unexpected Costs
After running the infrastructure for a while, I noticed that my monthly bill was higher than I expected. The bulk of the cost was coming from the load balancers, roughly $18 per month. It turns out that the recommendation for upgrading HTTP to HTTPS for an existing load balancer, Google recommends having an HTTP load balancer in front of the HTTPS load balancer to send the traffic to HTTPS that way. As much as I loved having everything set up just the way I wanted it, I couldn't justify the cost for just a vanity website. So, I downgraded to a static website hosted entirely in Firebase. It's under 10kb and does everything I need it to do. Sometimes, keeping it simple is the best way to go.
Lessons Learned and Future Plans
Overall, I learned a lot through this experience. I was able to get hands-on experience with GCP and Terraform, set up some interesting infrastructure, and even learn some important lessons about cost optimization. While I don't have my GCP certification yet, I'm planning on going for it in the future. For now, though, I'm focusing on my CKA certification this week. I'll be sure to keep you all updated on how it goes!
And that's a wrap! Deploying the Cloud Resume Challenge in GCP was a fun and challenging experience. I hope sharing my story helps inspire others to take on the challenge in their own unique way. Thanks for reading!