The Cloud Resume Challenge

Where do I begin?

What an experience! For those who do not know what the #CloudResumeChallenge is, here is a link explaining the challenge from Forrest Brazeal #Thecloudresumechallenge For a quick background on myself, I graduated with a B.S in Human Resources & Business Management. Starting at the end of 2019 I began learning how to code. I've taken Andrei Neagoie Python ZTM course and have been doing some personal projects in my free time. So, prior to this challenge I didn't have any experience working with cloud resources. However, if you're like me don't worry, AWS does an amazing job giving you all the resources you need to use their services, especially as a newbie. It may take some time and hands-on walkthroughs to completely understand the services and how they work, but no worries AWS has extensive docs and their are numerous blog posts that give you exactly what you need. This blog post contains a short walkthrough of the steps I took to complete the #CloudResumeChallenge and what I've learned from this experience.

sales-i

Getting Started

I started by finding a simple HTML template that I liked online. I found the perfect template on Goskills.com. This also comes with the accompaning CSS stylesheet. I did use the template to start, but made several CSS and HTML adjustments to match my website (which was created before the challenge). Using a template soon became a pain because it made it harder to style my resume to look like my website. I decided to use Bootstrap because it made it a little easier to handle this customization. In the end, I was happy with the results but I wish I would have just started from scratch due to the amount of modifications i ended up making anyway. See if you can guess which template I started from on Goskills.

Setting up the frontend

Next, I made an AWS account. The first service I used was S3, where I created a bucket to try to get a feel for it. Once I felt comfortable I made my real S3 bucket and hosted my frontend content as a static website. Once the site was hosted I purchased a domain name (chadiamond.io) in Route53. After purchasing the domain on Route53, I used Amazon Certificate Manager to get the certificates needed to secure the site. Once the certificates were created I used Amazon CloudFront to secure the site (over HTTPS).

Setting up the backend

I spent a few days clicking around in AWS IAM, Lambda, DynamoDB and API Gateway. This is a good way to get to know the service and what it does. Once I felt comfortable, I set up a Visitor count function that my frontend would use to track the amount of visitors who visit my site. To start, I created all of these resources useing the console. By the time I got it working I had encountered dozens of errors. First, I had to figure out how I wanted to store my visitor count in DynamoDB. This was fairly easy since I decided I only needed to read and write the same record. Next, I used Lambda to write the code needed to read and write from my DynamoDB table. It took me a few days, but I finally got this working (although I created all the resources manually). I also created my python tests using pytest. It was a simple test that just looked for a successful response (more on this and CICD later). At this point I only knew how to use the unittest library, but I came to find it was much easier and faster to use pytest (because of the tutorials I found for SAM) instead.

Connecting the two

After my Lambda function, DynamoDB table and API Gateway were able to work together I was ready to write the JavaScript needed to display my visitor count. The flow needed was Fronted (S3) -> API Gateway -> Lambda -> DyanmoDB. Once I was able to get Javascript to hit an API and update the screen, my website kept giving me a CORS error. I copied my a bunch of variations of my error message into google to find the resources I needed to fix this error. The problem ended up being related to enabling CORS in API Gateway AND returning an appropriate response from Lambda.

Infrastructure as Code (IAC)

Now that I had everything working, It was time to work with SAM to deploy the resources I needed for the project as infrastructure as code. This was my favorite part because SAM makes it extremely easy to deploy your services using infrastructure as code (AWS CloudFormation behind the scenes). Again, I deployed a practice project first because I was not confident using SAM, and I did not want to mess-up my working web-app. Now I can honestly say this was not an easy one and done as I made quite a few errors. YAML Indentation was one of the hardest things for me when it came to deployment. I realized that although SAM generated alot of the started code for me, undersatnding it would be necessary to add more resources such as a DynamoDB table. I kept receiving error message after error message but I was persistent and finally got it right. When the time came to SAM deploy my project I was ready and confident it would work, and the cool thing is now that I had it as IAC I could create and delete the resources at will. This is when the real usefulness of IAC was clear to me.

CI/CD

Finally, after my project was fully functioning I used GitHub Actions to set up CI/CD. I have a few projects hosted on GitHub but I had never worked with or heard of GitHub Actions. The first thing I did was read GitHub's documentation to see how everything should be set up. Next, I had followed their docs and made my backend redeploy (using a cool SAM Github Action) once the tests were passed. Next, and this is the most useful part, I setup my frontend GitHub repo to automatically push to s3! This was really cool if you are anything like me and like to change things often. This was a game changer because now if I want to edit my website, I just make the change locally, commit to GitHub and the change will be live!

Getting Certified

Lastly, I created a study guide and studied about 2 weeks for the cloud practitioner certification exam and passed! This was a fun project and I've aquired skills that I will continue to develop. I highly recommend this challenge to anyone who is learning to code or learning cloud development. Please reach out to me on Twitter LinkedIn or via email if you have any questions! P.S I am happy to share my study guide if anyone is interested.