BMW Mechanic to "Cloud"
Tags: gcp, cloud, codenewbie, computerscience
Published: 2023-04-07 02:14:15





![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yxdtla3molk0pzmduxbm.jpeg)

Hey Everyone! My name is Maher Salhani and I live in Mission Viejo, CA where I have spent the majority of my professional career as a BMW Master Technician and large-scale project manager. This past year, I decided that it was time for me to follow my passion and transition into the IT industry (more specifically the cloud). Now I know what you're probably thinking, here's another guy who saw a TikTok about "breaking into tech" and decided to try it out for two weeks. I mean what could go wrong?!

Well, I started the same way I usually start anything, I picked the most difficult challenge I could find and see if I can take it down. For the next 4 months, I spent every day after work and on the weekends studying for my Google Professional Cloud Architect certification, and with much sweat, grease & a keyboard, I passed.

Now even though this was a major feat to accomplish, I knew I still had a lot of work to do since I had no real-world experience with what I was learning. One thing was clear, I needed a project large and complex enough to really stretch the limits of what my certification had taught me and execute it well.

This is where the "Cloud Resume Challenge - GCP Edition" came into play. It wasn't like everything else out there with a tutorial you can just follow along, it was 16 complex steps that had a few linked articles to help you understand the world of hurt you were about to undertake and the rest was up to you.

**The Mission:**

1. Getting a Cloud certification was a prerequisite to the challenge.
2. The resume needed to be written in HTML, styled with CSS and hosted in a Cloud Storage Bucket.
3. The website had to have a custom domain name and be secured with HTTPS using cloud CDN.
4. On the website there needed to be a visitor counter written in Javascript that was backed by a Cloud Firestore database holding the count.
5. This database would need information, so a backend Cloud Function written in Python would need to be provisioned.
6. An API was required to middleman the interactions of the microservices.
7. Tests were written for the Cloud Function to ensure a failsafe for possible breaks caused by future changes.
8. The backend portion of the project had to be built and deployed from a Terraform template through Terraform CLI.
9. CI/CD needed to be set up through Github for any future changes.

Finally, the journey needed to be documented in a blog post to make sure we could articulate each step properly.

**The Gauntlet**
Now, I need you to understand that the biggest thing I had ever built before this was a calculator in C++ years ago. But, I knew that I had a knack for problem-solving and understanding complex systems from my BMW experience (I mean a 7 series has over 200 modules in it that all need to work together).

**Where the rubber meets the BMW**
I started by taking a few days to learn HTML and CSS from YouTube videos while also updating my dusty resume. Next, I uploaded the files to a Cloud Storage Bucket and purchased a domain from Google Domains. Afterward, I set up an HTTPS load balancer and everything seemed to be going smoothly until I tried to get an SSL certificate to clear. It took some time to finally figure out that I needed to make sure my Google name servers were correct and that the proper custom records (type A & CNAME) were set up.

Up next was creating a Firestore database and a Cloud Function, which was simple enough, but they had to communicate with each other, and for that, I needed to write some Python code for the function to tell Firestore to capture the count. I put my head down and through apps, freecodecamp.com, and YouTube videos, I learned Python. Now, when it came to writing the actual code, it was difficult to say the least, but with a little persistence, I developed something that worked well. 

**The CORS black hole**
CORS debugging is now joke, I had a few sleepless nights trying to figure out CORS. This was difficult because the project had many aspects to it. I wasn't sure where CORS permissions needed to be added or in what form for that matter. Do they go into the API-Gateway spec, the cloud function code, the Javascript visitor counter code, or all of them? No matter what I tried, the website was not accessible, so I had to walk away until I could get my head around it.

The next day night just sitting there, I realized that I was dealing with 3 issues that were all connected (no access to the function, API gateway, or Javascript visitor counter). I remembered one of our BMW pillars of diagnosis was: "When dealing with multiple errors in a system, they usually all stem from one issue". It became clear that all the different components were trying to trigger a cloud function event, so the problem lay in the function code. I quickly added CORS headers to allow the API gateway URL to access the function, while making sure to use a GET OpenAPI spec configuration, and just like that it all started to work.
Finally, for CI/CD, I put together a repository that utilized GitHub actions which allowed me to avoid making changes to my code manually.

**The Finish Line**
And there you have it, after weeks of working on this non-stop, I have a full-stack website that's over-engineered on the backend with various GCP services.

Check out my site/resume at: https://www.Maher-Resume.com/

I hope to whoever is reading this, that you realize your dreams are not that far off if you are willing to put in the time. It won't be easy, but if you stay the course, the possibilities are more than you or I could have ever imagined.

Maher Salhani
The Stumbling Cloud Architect