Cloud Resume Challenge
Tags: career, aws, devops, serverless
Published: 2022-08-29 21:19:00

![Don Safar Image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/59bv6o2xl9l4tth23g96.jpg)
Welcome! My name is Don Safar. In the summer of 2019 I was in the process of winding down our company, Safe Haven Holding Corp dba Safar Motor Group. Prior to Safar Motor Group, I worked at Lender Processing Services for fifteen years, which became part of Black Knight Inc under enterprise restructuring. During my tenure at LSI, I became an SME within a group that would help transition our legacy system to a newly built modern system. I was tasked with transferring knowledge of existing workflows and modifying legacy workflows into the new system. This was my first full time job in the IT industry. I started at the very bottom of the company and eventually transferred to the IT department. So enough of the back story let's get to what this post is all about.

The Cloud Resume Challenge or CRC was way more than just learning to do some cool stuff in the cloud. The CRC taught me how to really push the boundaries of what I thought I was capable of. Actually it was more of a reminder of my capabilities. Below you will find the project broken out into six phases. In each phase I go over my challenges and how I over came each of them. 
<a name="TOP"></a>
Table of Contents
[Phase 0 - AWS Certification](#CERT)
[Phase 1 - HTML,CSS, S3, DNS, SSL, AWS Cloudfront] (#HTML)
[Phase 2 - API, Lambda, DyanomDB](#LAMBDA)
[Phase 3 - Java Script, API, Smoke Test, CORS](#CORS)
[Phase 4 - IaC, CI/CD](#IAC)
[Phase 5 - Blog](#BLOG)
[Cloud Resume](https://donsafar.com)
 
Here are the detailed instructions of the Challenge.
[Cloud Resume Instructions](https://cloudresumechallenge.dev/docs/the-challenge/aws/)

### CRC Project
#### <a name="CERT"></a>Phase 0 - AWS Cloud Practitioner Certification
1. Can I do this?
2. Sit down we need to talk...

This foundational phase was about acquiring my AWS certified cloud practitioner certification or AWS CCP. This phase of the project I had already started before finding the cloud resume project online. I did not know anything about the cloud and made up my mind that I wanted to pursue this as my new career. I started searching for projects that would give me hands on experience in AWS cloud. Once I accomplished the AWS CCP certification, I started a sub phase which was to start studying for AWS Certified Solutions Architect - Associate. This is the first step in my journey and it was full of excitement and unknowns. As I started down this road of learning from the ground up, I was really excited for what the future holds and where my career was headed. I did have some prior knowledge of networking and web server setup from my own personal experience through the years. I had once setup a home network so I could play Mech Warrior with Brother and Stepson on my intranet, as we were still stuck with 56k modems for internet connectivity. The internet was just coming on the scene and the buzz was very exciting as technology was making its way into everyones home. I have always been fascinated with technology as my father was in IT when construction workers made more than a programmer. His career in IT had a great influence later in my life. One of my first jobs in high school was to boot up and watch the MainFrame on Saturday morning for the local bank drive through. I literally had to load the giant hard drive into a mechanical machine, then type some commands on the terminal and pray nothing happened until the drive through closed at 12:00 PM on Saturday.  It was always a freezer in there, which made staying awake for a 16 year old very hard. Back to the certifications, studying for the solution architect builds right on top of the CCP cert. I used [acloudguru](https://acloudguru.com) and [tutorials dojo](https://tutorialsdojo.com) to study for the AWS CSA certification. It was a lot more in-depth and challenging than I originally had anticipated. At one point when I made a 45% on a tutorials dojo exam, I truly wanted to quit. It clearly pointed out that I have not learned the depth that was needed for to pass the exam. I was devastated that all my hard work brought me to a giant failing score. I had to search my soul to continue on. I had to answer the question, why am I doing this? The best thing I did was turn off my computer, take step back and talk myself into looking back at how far I came and the things I have learned. If this was easy everybody would be doing it. Once I got my mental aptitude correct and reminded myself that I am not a quitter, I can do this, I jumped right back in. There will be set backs, but that is the best way to learn if you let them. With all the set backs, I did pass my [AWS Solution Architect Certification](https://www.credly.com/badges/1b7214ca-bb6a-4d81-9b0a-24685f1c81ac/public_url). I got to practice this one step forward two steps back principal the entire cloud resume challenge. I would have a victory then a set back. This was a never ending process and has made me look inward each time. I originally thought this was all about building a cloud resume, but it was way more than that for me. It was a lesson in reminding myself that I can do great things. I can always do way more than I think I can. The only way to learn these type of lesson are through set backs that you learn from. Keep pushing forward and remind yourself along the way, why am I doing this? The why for me, is this is something I enjoy doing and it will provide a new and exciting career in the cloud. 

[top](#TOP)

![Cloud Diagram](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/meurzit07jz9x01wyf0v.jpeg)
#### <a name="HTML"></a>Phase 1
[](#html)HTML,CSS, S3, DNS-Route 53, AWS Certificate Manager, AWS Cloudfront
1. How do you do this?
2. The answer is out there, you just have to find it.

I wanted to keep the first part of this phase simple. I used start bootstrap for my HTML and CSS. It took me a while to figure out the css, everything else was pretty straight forward. Through trial and error I was able to modify the color scheme of the website to make it a little more personable. The DNS and SSL certificates are pretty straight forward in the AWS console. When it came to CloudFront the only thing I knew, was it was a way to cache your website on a global network to reduce latency. I tested this while on vacation in Las Vegas with one bar of cell service and was able to load the site very quickly as If I had five bars of service. I was quite impressed with how well Cloudfront worked. I found that AWS had a great [tutorial](https://docs.aws.amazon.com/AmazonS3/latest/userguide/HostingWebsiteOnS3Setup.html) on the setup of S3 and cloud front. Knowing what to search for and where to find the information is key in technology as it is constantly changing. 

[top](#TOP)


![API Lambda Diagram](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tkzqyecw7k0kn4f310ny.jpeg)
#### <a name="LAMBDA"></a>Phase 2
API, Lambda, DyanomDB
1. Lamdba what?
2. Huge learning curve here

This phase of the project is really were I started to meet some road blocks. You don't know what you don't know. I first needed to figure out how does Lambda work. It is a Serverless work horse. You can have it on standby waiting for a trigger to happen and then have it run your code to accomplish a task. In my case I needed Lambda to wait on the website to request the vistor count. Once that request is pushed to Lambda it will go and fetch the count from the database which is DyanmoDB. Once it fetches the count it needs to add one to the count and then write back to the DB  and display that result to the website visitor counter. The lesson from this is not necessarly the counter itself but building and learning the underlying cloud structure to make that happen. This is a fundamental building block on how to use the cloud to solve business problems. Is there an easier way? Absolutely, but this exercise is to get your mind thinking on what is possible with the cloud. It took me a couple days to figure the correct syntax for python. I would find a solution that would meet half my criteria and I would have to search else where for the other half. I remember the first time I got a 200 response with the correct count, I was on cloud nine! That joy was soon extinguished in the next phase and the dreaded CORS issue. That is Cross Origin Resource Sharing. One other thing I took away from this, there is definitely a more efficient way to run this code. My goal was to build the functionality first then fine tune along the way. I have seen this same concept over my 15 years experience with LSI and some of the deployments. When looking back and what I know now, the definition of done was a pretty low bar back then, as we had some pretty bad releases go out to production. The people that suffered initially were operations. The real pain started when IT had to get the issued resolved. Ahh the balance of getting it done and getting it done enough.

[top](#TOP)


![CORS Diagram](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ucwuzmsi14jdnmbhy0n7.jpeg)
#### <a name="CORS"></a>Phase 3
Java Script, API, Smoke Test, CORS
1. I hate CORS...
2. I have learned how to troubleshoot CORS and API

This phase of the project I connected the frontend to the backend to make all this magic happen. I was on cruise control from my last accomplishment. I felt as I could take on anything. That came true when I built the API, got the javascript coded on the frontend to send a request to the API on page load. Drum role please..... and bam nothing... no counter just a blank space. I went from the top of the mountain to bottom in one second. It took me weeks to climb this high and now I am back at base camp. First I looked over my API and from what I knew, it looked like it was setup correctly. I tested my lambda function and got a 200 response in the AWS console. I did not even no where else to look. As I sat staring at my screen wishing I could just use some magical brain power and poof it would work. I decided to right click and inspect element to see what would happen. That is when I noticed the red ! and the Failed to load resource: Origin https://donsafar.com is not allowed by Access-Control-Allow-Origin. I had no idea what this meant. I had to google and eventually found out this is a CORS issue. Basically the API was not allowing donsafar.com access to the API response. I learned two things. The first, if S3 is redirecting www.donsafar.com to donsafar.com the Access-Control-Allow-Origin 'donsafar.com' works great. When you use edge locations in CloudFront there is no redirection and you have to put '*' wild card. I also learned that you can only specify one entry in the Access-Control-Allow-Origin. The second thing I learned is, you have to have an options setup to get a preflight handshake to keep everything happy in the API and CORS. After many days of trial and error I finally got everything happy and working! The front end was tied to the back end and everything was working. I did it! I have conquered my own giant. Victory is mine! Right about the time I thought that, Infrastructure as Code was going to take my victory and hold it hostage. Read below for my next great giant I had to conquer.

PS. When making changes to the API, make sure you deploy them. This will save you from running in circles looking for changes that never made it to production......

[top](#TOP)



![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kyc96kfxia1jbl5kd89l.png)
#### <a name="IAC"></a>Phase 4
IaC, CI/CD
1. IaC.. I play for blood
2. Terraform became my new friend..

IaC was another new first for me as I was only introduced to this during my certifications for AWS and only briefly. I first looked for short cuts to get this done. To my amazement the only short cut was hard work! I knew this deep down but I worked so hard to build what I had from scratch. The only problem with my project to this point is it was done in the console. I asked myself, could you do ten of these with all this clicking here and there? No way that would be the least efficient way and is very prone to mistakes. So I first started out trying to learn AWS SAM. I found the community support for this was very little compared to terraform. I learned that terraform is more of a cloud standard that can be used in all cloud providers. I found the documentation and support for terraform to be easily found via google. After two to three days wrestling with SAM I switched to terraform and started the learning process. During the process of trying SAM out I completely blew up my DNS as it changed way too many times. In my mind the DNS servers were probably like, we have no idea where to push this, as it has changed a thousand times! It took me a good two weeks at comparing the console to the code to figure out if I changed this code will it change this in the console. The console was my baseline as this was all still new to me. The more I use AWS the more I know exactly where things are and what settings need to be set. Each iteration makes more and more sense in the code as I can visualize the process in the console. I know over time this will all become second nature. I am not an expert and still have much to learn with terraform. I have learned to how to build modules for my project and push those to git hub then to cloud formation for deployment. Terraform is very efficient and easy to learn. The support has been great. One thing that I am waiting on,  is the support to come out for using Origin Access Control instead of Origin Access Identity. Once I learn this process of migrating the code from OAI to OAC I will test it out and change my code. For now I have manaully changed that setting in my CloudFront origin. I also had to do some research on my DNS issue and found that I need my registered domain DNS and my hosted zone DNS to match. This took me two days to learn this lesson. Once they matched and propagated out, I could see my site again. I did have to change my router DNS servers to point to google DNS as my ISP lacked updating theirs in a timely manner. Now I know to check that your DNS server is being updated timely or you never see your changes.

[top](#TOP)

#### <a name="BLOG"></a>Phase 5
Blog
1. Where do I begin?
2. Looking back can be positive if you let it.

The cloud resume challenge has been a wonderful growing experience for me. It has taught me many good and bad things about myself. I have chosen to let my failures train me. My biggest takeaways are outlined below.

"Everyone has a plan until they get punched in the mouth"- Mike Tyson 

- You are never there, keep learning so you don't get left behind.

- Sometimes you will face things that are so big, you don't know where to start. Don't be overwhelmed, but work on the small victories that will add up to the big ones. 

- Learn from your mistakes. Once you figure out the issue, put that in your tool belt for later use.

- Stay positive, especially in your thinking as that is where it all starts.

If you made it this far I want to thank you! I also want to thank @forrestbrazeal for helping me to learn more about myself through this project.{% embed  https://cloudresumechallenge.dev/blog/top-cloud-project-ideas-for-beginners/ %}

[top](#TOP)