Continuing to learn: My journey with Cloud Resume Challenge
Tags: aws, terraform, cloud, career
Published: 2023-04-18 19:41:53

As someone who is constantly itching to make or learn something new, I usually turn to trying out new recipes in the kitchen (like this [addictive chili oil](https://www.youtube.com/watch?v=omuoTY3T16w)) or self-hosting a service that I might personally use like a personal Google Drive/Docs alternative with NextCloud.

So, imagine my delight when I found out about a challenge that would allow me to  learn something and make something new at the same time - [Cloud Resume Challenge](https://cloudresumechallenge.dev/) by Forrest Brazeal. For those unfamiliar with the challenge, it is a 16-step challenge that sets you on a self-learning journey of building, testing, automating a resume website deployment on a cloud platform.  Having recently become a certified AWS Solutions Architect Associate, I chose AWS as my platform.

_TL;DR_
Made a serverless resume website on AWS
Find [the website here](https://resume.kgmy.at) and the source on [GitHub](https://github.com/myat/crc)

## Making the frontend
The frontend is kept to a minimal HTML/CSS style with a javascript calling the backend API to update visitor count. The fun part is in the deployment of these files. All of them reside in an S3 bucket. To further enhance security and scalability, they are served through a CloudFront distribution. Finally, I can issue an SSL cert for my domain through AWS Certificate Manager and point it to CloudFront.

## Building the backend
The backend was a bit more involved to put into reality. Apart from simple bash scripting for personal usage, I haven’t written any line of production code in my life. So, I brushed up on my scant Python knowledge and pieced together a Python Lambda function to store and manage the view count in a DynamoDB table. By letting the API Gateway act as a proxy to the Lambda function, we now have a secure and scalable API ready to go.

## _“It’s working as coded”_
Ah, the joys of testing. Figuring out pytest and reading the moto documentation were not joyful experiences until I realized that my own typo in a mock DynamoDB table set-up was causing the test errors. After a few days of constant head scratching, I came to respect the wise saying: "Read The Friendly Manual". And don’t rerun the same test hoping it will pass the next time.

## Look Ma, No Clicks!
As much as I enjoy clicking through a UI or issuing AWS CLI commands (what an odd thing to type out) to provision the necessary infrastructure for the site, they add up with the constant setup, test, and teardown cycle. Terraform ends up being a lifesaver, providing a significant departure from the clicks or the series of CLI commands and scripts.

![Look Ma!](https://media.tenor.com/luhgflSBRw8AAAAC/no-hands-look-ma-no-hands.gif)

Add automation through GitHub Actions and we get very reliable, precisely repeatable workflows of deploying for testing, running tests, and all the way to production deployment. It took a few rounds of trial-and-error and RTFM _again_ to make the reusable workflows use repository secrets properly. Thanks [`secrets: inherit`](https://docs.github.com/en/actions/using-workflows/reusing-workflows#using-inputs-and-secrets-in-a-reusable-workflow)! No more clicks!

<figure>
  <img src="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r132tnq1nkak24ac6ej7.png" alt="Imagining the pipeline before building it">
  <figcaption>Imagining the pipeline before building it</figcaption>
</figure>

## The result

You can view the result at my [resume website](https://resume.kgmy.at) and all codes, tests, IaC and CI/CD workflows can be found in this [repository.](https://github.com/myat/crc)

Here's how the overall architecture looks like.

<figure>
  <img src="https://github.com/myat/crc/blob/main/docs/images/CRC_Architecture.png?raw=true" alt="CRC website overall architecture">
  <figcaption>Overall architecture</figcaption>
</figure>

## What’s the point of all this?
Looking back at this challenge, I have had a couple of light bulbs as well as duh moments.
* The best way to learn is to do it hands-on. You usually don't need more than your willingness and commitment to start this process. _"Hello, World!"_ comes to mind when trying to start something. Just start with something small. Understand how it works on the smallest scale, and expand on it.
* Don’t forget to Read The Friendly Manual along the way. It is the only truthful map for your journey. Yes, a Stackoverflow post might point you in the right direction for once or twice but if you didn’t understand the principle behind a solution, you’re bound to get lost again and you may not even notice you’re lost.
* Continuous learning could be a source of joy in life. I believe humans are creatures of learning as much as we are creatures of habit. As we age, it's easy to fall into a routine and become complacent with what we know. However, continuous learning can help us stay engaged with those around us and find joy in discovering new things. Be it a new piece of technology, a new hobby or even learning a new recipe, picking up something new to learn could be a fulfilling experience.

## What’s next?
As the challenge has piqued my interest in the solution architecture side of cloud, I’m actively seeking opportunities in this area. Since I’m fascinated by IaC, automation and configuration management, I will explore deeper into Terraform and Ansible for my personal projects.

For the resume, I will look into migrating the frontend to an SSG like [Hugo](https://gohugo.io/) so that I can learn to add it into the build process.