Cloud Resume Challenge
Published: 2021-11-25 16:34:46

[www.ajm-resume.co.uk](www.ajm-resume.co.uk)

Hi all, I recently completed my first start to finish AWS Cloud project, creating and provisioning a website version of my CV. This blog is about the path I took and what I found interesting, or think could be useful to others starting out. I’ve tried to keep below as “Spoiler Free” as possible, so you can enjoy figuring these things out on your own too. I’m also hoping that someone who is on the fence about the challenge will read this and decide to take the plunge. If that’s you scrolling through right now, go for it, you won’t regret it!

The idea came from https://Cloudresumechallenge.dev/ the challenge set’s out 16 steps and lets you figure the rest out yourself, that means a lot of googling and a wee bit of hair pulling, but I struggle to put into words the amount of fun I’ve had along the way. All the steps are available free on the website, but I recommend buying the book. It's a good read and there's a lot of useful insight for someone coming from a non-Cloud background. Fair warning, it doesn’t do much hand holding, but that's a big part of the appeal. 

<img width="100%" style="width:100%" src="https://media.giphy.com/media/ncbdoCpKerEbK/giphy.gif">

####1. Certification AWS CCP
This was the first step, getting my Cloud practitioner certification, it was also probably one of  the easiest, due in no small part to the extensive resources available. If you ask me, and I’m well aware you didn’t, no one should, I’d start with “AWS Cloud Practitioner Essentials'' on Amazon skill builder, then there’s a 4 hour video on FreeCodeCamp’s youtube channel, which covers a few areas the official course skims over. If you’re not in the habit of taking tests, definitely get your hands on a few mock exams, there’s some on whizlabs which are very reasonably priced, and the question format is the same as the actual test.

####2. HTML & 3. CSS
I’m going to group these two steps together. This was the part of the project I started first and finished last. When I’d created a very rough draft of the website and got it working with some basic formatting, I realised that I was designing the website around the HTML & CSS I knew how to write, as opposed to designing the website I wanted and then learning how to create it. So I put this on the back burner while I took care of some of the backend stuff.

####4. Static S3 Website
Once I had the rough draft of the website finished, I uploaded it to an S3 bucket, worked my way through the security settings and voila, I had a website hosted on the Cloud. Although it was nowhere near ready for human eyes, this felt like a big moment, concrete proof of progression, that all my hard work was finally paying off. This feeling lasted a good 5 or 6 minutes, until I updated the index page and it immediately went offline. After I had a completely rational and proportionate reaction to this development, I went through and checked my permissions. In my haste I had created a bucket policy that allowed public read access, then a few lines down immediately removed it.

####5. HTTPS & 6. DNS
I’m also going to group these together as they were both done in the same session without much drama. I purchased a domain name through Amazon Route 53, then configured a Cloudfront distribution which used HTTP’s to ensure a secure, encrypted connection. While the way the security actually works and how it protects your website and origin from attacks is super interesting, I’m afraid the story of how I did it isn’t very thrilling. I might not even bother finishing this sentence and

####7. Javascript
This was something I had learned previously, so was relatively easy to implement. The main use of this in the challenge was to trigger the api and call the Lambda function. I decided to also have the homescreen type out the text in the body, there were two reasons for this. One, I thought it kinda looked cool, and two, it helps to hide the milliseconds of lag caused by actually calling the API.

<img width="100%" style="width:100%" src="https://i.redd.it/39rvm3rxmsq61.jpg">

####8. Database
I set up a DynamoDB database to track the number of visitors to my website. After learning SQL it felt almost blasphemous to set up something that used a simple key value pair system. Even the term NoSQL, felt like I was reading the whitepapers wrong. However if you need speed and flexibility, you’re gonna have to trim some functionality. Now unless a social media trend involving visiting my website as many times in an hour as you can kicks off, storing the number of hits won’t cause an issue no matter which database I use. So as with most everything else on the challenge, I went with the method I was less familiar with.

####9. API
So this step was more interesting conceptually than it was complicated to do. Essentially, you don’t want your website to interrogate your database, you need to configure an API to trigger your Lambda function and return the information to your webpage. It’s pretty simple to set up using the AWS console, so if you want more of a challenge, have a go at using the CLI, hopefully you will have used it a little bit before now, but you know what they say, “practice makes you a little bit less useless than you were before”. 

####10. Python
Actually writing the Python script was the simplest part of this entire project. I've been using Python for over a year now, and the actual script was only about 25 lines of code. If you are new to coding, this along with Javascript may present a bit of a challenge, but as with everything else, just take your time, it’s not magic, you will get there.

####11. Tests
I’ll go into it in a bit more detail in step 14, but simply I used the Serverless Framework in conjunction with Github Actions, to check for any syntax errors or obvious faults in my code before the update was deployed to the Cloud.

<img width="100%" style="width:100%" src="https://media.giphy.com/media/7MZ0v9KynmiSA/giphy.gif">

####12. Infrastructure as Code
I used the Serverless Framework to provision and update my Lambda function using YAML and Github actions. If you get a bit stuck here, don’t panic, I’d rank this as one of the more challenging parts of the challenge. Especially as you’re probably trying to combine this with your source control and CI/CD. Take a deep breath, break it down into manageable chunks and work through them. My advice would be to  find a simple tutorial online, it doesn’t matter if it's Python or Node JS, just follow along and get something deployed through Github to your AWS account. Once you’ve got it working, go back and try to understand it step by step as you build your own deployment. 

####13. Source Control
Now this, this was fun, I had used Github previously when I was working on a project on both a Linux and Windows computer, but that was just me sending code back and forth to myself, it was nowhere near as cool as “push button to update website”. You can get the Github desktop app to make deployment a little simpler. 

    IMPORTANT WARNING!
Whatever you do, do not put your access key and secret key directly into your code. You can use a feature of Github called Github secrets, you can look up how to use it on your own, but this is just a tip to prevent you from compromising your own security.

####14. CI/CD (Back end)
As I mentioned in Step 11 & 12, this was done using Github & Serverless Framework. I can’t go into too much detail without creating a walkthrough, but essentially, any updates I commit are tested by Github using Flake8, and if it passes all the checks, it is pushed to my AWS resources.

####15. CI/CD (Front end)
To update the actual website, i.e the S3 bucket and the Cloudfront distribution. I used CodePipeline to pull the updates from Github repository and deploy them to the S3 bucket, I then added a step to invalidate the cache in CloudFront, so that the changes would take effect immediately. This is different to how the Cloud Resume challenge lays it out, it suggests you use Github actions to do both the front & back end, but it’s not the boss of me, it’s just a book. A very good book that I recommend to anyone not sick of me talking about the book, but a book all the same.

####16. Blog post
Hey, that's this! If you’ve made it to the end, thank you sincerely for taking the time to read all that. I hope it came across that I've loved every second of the process. If you are reading this as someone thinking about doing the challenge yourself, what are you waiting for? If you were curious enough to read the whole blog, then it’s clearly more than a passing curiosity. Try it, you’ve got nothing to lose, and even if afterwards you decide you never want to write another line of code, or even think about the Cloud, I promise you won’t feel like you’ve wasted your time.