My AWS Cloud Resume Challenge Experience
Tags: aws, cloud, serverless, devops
Published: 2021-08-04 01:47:55

<h1>About Me</h1>

I'm a QA/SDET living in Austin, TX with 10+ years experience in tech, but I've been interested in devops before it was named. In 2008, I was working as a manager in a NOC. I remember writing queries to monitor the real-time stats of my employees in Microsoft SharePoint and color coding them with red, yellow and green. I didn't have to guess who needed help or who was on track, I just knew I would be "alerted" when needed. I wanted to do more work like this, but I didn't know what or where to start. At the time, I considered myself just a manager.

Several years later, I made the switch back into technical. When I got write access for Google Cloud Platform (GCP) at one of my jobs, my role got exponentially more exciting as I was able to help train the machine learning algorithm for a chatbot in Google Dialogflow and create a testing framework for it in Node.js. Getting permission for that project was a lengthy process and my goal with the Cloud Resume project is to prove my AWS chops so I'm not in a position of waiting so long for access next time. Recently, I joined a team at a company which uses the phrase "one team, one heart" and is one of the few positions I've had where the wall between QA and Dev is so low that I can bunny hop right over it when needed, chiming on code reviews or adding test IDs to front end repos.

Right now, I'm helping QA their infrastructure as code. This mostly consists of small tests such as deploying an artisan command in AWS OpsWorks and querying the database for results. As all those small pieces of stories come together and as I slowly test through the various epics that the stories are made from, it will result in me having more of an end to end understanding of our architecture. 

Hope you enjoy!

<h1>The Challenge</h1>

<a href="https://cloudresumechallenge.dev/">The Cloud Resume Challenge</a>

I'd highly recommend buying the book to start. The author allows for a lot of substitutions that I would have chosen had I read through all of his documentation beforehand. If I could re-do anything about the challenge, I would weigh the pros and cons of different ways of implementing the challenge before diving right in.

<h2>The Certification</h2>
Step 1 of the Challenge is getting the AWS Cloud Practitioner certification. This was a pretty easy certification. I initially tried to take the Solutions Architect Exam, and when I sat down for it, all the questions seemed to revolve around tools I've never used in the real world and wanted you to memorize a lot of pricing. It seemed very sales-oriented and not worth it. The CP exam, however, just covered the basics of most of the services that I actually do use, and didn't require more than a few weeks of studying. I passed that my first attempt and pivoted to this project before deciding I'd rather go for the Developer Exam instead of Solutions Architect.

<h2>HTML and CSS</h2>
I wrote my resume in HTML and CSS. Pretty easy, I've actually done this once before. I spent a little more time at it for the challenge because I wanted it to look more styled and less blocky. This took a couple of nights.

<h2>Creating a static S3 Website</h2>
Again, this was pretty easy as S3 is a huge topic in both the Architect and Practitioner exams, but I did have to wait a bit for AWS to approve my domain name. 

<h2>HTTPS + CloudFront + DNS</h2>
Here's where the challenge started for me. I knew I needed to protect my website with HTTPS but I didn't know whether I needed to create the SSL certificate myself. I also didn't know which order to do things in. I went to youtube for some tutorials and some people started with DNS and ended with CloudFront. Other people started with CloudFront and ended with DNS. Some people did some fairly strange things with multiple buckets. I learned that there is no "one right way" in AWS. In the end, the DNS was fairly simple but my CloudFront distribution wasn't pointed at a specific file in the bucket, my index.html. While it was at the bucket level, my domain name only displayed style errors in XML. It took over a day to figure that issue out and get back in business.

<h2>Javascript</h2>

I ran into another issue here where I added a dummy counter to my front end (just a random number). When I uploaded the amended file to my S3 bucket and refreshed the domain, my update didn't show. I didn't know about invalidating CloudFront endpoints or why I needed to do so. AWS documentation was helpful here: <a href="https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/AddRemoveReplaceObjects.html">Adding, Removing, or Replacing Content That CloudFront Distributes</a> 

<h2>Databases, Python, Lambda</h2>

I knew the sequence of events was going to be

S3-> API Gateway -> Lambda -> DynamoDB 

Having DB experience, I ended up creating a DynamoDB table first and hooking Lambda up to it. I then created a python script to update the visitor count in the DynamoDB table using the <a href = "https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/GettingStarted.Python.03.html#GettingStarted.Python.03.04">Atomic Counter</a> function. A tutorial that came in handy was this one <a href="https://www.youtube.com/watch?v=-8L4OxotXlE"> here</a>. Also, this <a href="https://hometechtime.com/how-to-return-multiple-attributes-from-dynomodb-via-a-lambda-function-and-api-gateway/"> article</a> came in handy on learning how to format my Lambda functions.

Another topic that came in helpful from studying the AWS exams was IAM. I needed roles with permissions between all the different components and my API gateway needed a trust policy. I'd recommend having a foundation in IAM before starting the project. 

<h2>API</h2>

Now, I have my api gateway set up and I was able to hit the endpoint URL successfully. My resume is updating my visitor counter with a PUT statement. 
<a href="https://www.geeksforgeeks.org/">Geeks For Geeks</a> was a helpful website on learning how to embed the javascript code in my HTML. 

<h2>Github, CI/CD, Tests</h2>

Steps 11 and 14 of the challenge required Python tests to be ran whenever there's an update to your code. I created a quick API response test and added the run step for the file in my github action's yml. Now whenever there's a commit to my project, the test kicks off. 

The biggest issue I had here was python and vscode working together. It took hours to find the command ```pip freeze > requirements.txt ``` and my github actions wouldn't kick off the run step without that file in my project. The other issue is that I still have more tests I want to run in pytest, but I have yet to figure out why my vscode isn't recognizing my import statements.

<h2>Infrastructure as code</h2>

Here's where I should have started. Since I was following the steps in order, I began the journey by setting up my services mostly manually through the console. Though I prefer the CLI, manual set up was much easier to follow the mostly GUI based tutorials in the AWS docs. I created a github action in my front end repo to sync any existing files to my S3 bucket and made a small change to test it that ran successfully. I then tried adding SAM to my project starting with DynamoDB, but didn't find many examples of editing an existing DB.

So, that's where I'm at today. I'm not impressed with SAM and I've decided to re-do all my setup in either the AWS CDK or Terraform. I followed <a href="https://learn.hashicorp.com/collections/terraform/aws-get-started">Hashicorp docs</a> to provision and terminate an AWS instance and I'm looking at re-deploying my services in terraform. Since terraform may destroy any components that it updates, there's a small chance I'll blow out my whole project on this step. 

So, I'm ending my cloud resume project for the time being, not 100% complete. However, every new bride needs a wedding website, and since my wedding has a hard stop date, I've chosen to practice deploying that website on terraform. I'll pick the AWS Cloud Resume Project back up after my save the dates are sent. In the meantime, you can view my project at <a href="https://julielaursen.com/">https://julielaursen.com</a>

Thanks for reading :)