Challenge Accepted!!!!
Tags: aws, serverless, python, javascript
Published: 2021-04-08 13:19:03

# HOW IT ALL STARTED!

As I was looking through certain job posts and building my network on LinkedIn, I went on DuckDuckGo to search for projects that involved Amazon Web Services (AWS). Towards the end of 2020 and the beginning of 2021, I had already received my AWS cloud practitioner and solutions architect associate certifications. Shout out to my friend Logan for inspiring me! 

There was a post on reddit that mentioned and gave a link to the [Cloud Resume Challenge](https://cloudresumechallenge.dev/). This single webpage could not have made me any happier. I found what I was looking for! I red all the instructions and thought to myself

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/12jujhd0xsytfakuxzu8.gif)

## INITIAL TOUGHTS

The whole Idea behind the challenge is to setup a website that displays your resume.

Here is a brief overview of the instructions:
	1. Get the AWS cloud practitioner cert
	2. Set up the html web document
	3. Set up the css web document
	4. Host the static website on S3
	5. Enable HTTPS security through CloudFront
	6. Configure a domain name with Route53
	7. Include Javascript to retrieve the number of website visits
	8. Store/update that number in DynamoDB
	9. Create an API that accepts requests from your webpage to retrieve that number from DynamoDB
	10. Use python to manipulate the number of website visits through Lambda
	11. Make tests to assure code functionality
	12. Create your infrastructure through code
	13. Set Up a CI/CD pipeline so you can automatically update your code through a repository
	14. Create a blog of the project!

The steps above are not exact, but it's how I interpreted it after scanning them for the first time.

My initial reactions were great! I already received the certification, so I felt like I've built up some great momentum. During my studies, I already knew the concepts behind S3, DynamoDB, Route53, CloudFront, Lambda, API Gateway, and etc. I WAS RARING TO GO! 

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s5rep0sw2pk2323qcg10.gif)

## 1 DOC, 2 DOC, 3 DOC, 4 👍

I have some background in web development, so creating the HTML/CSS/JAVA documents weren’t all too hard. For me, I always want to make sure that the content I envision is what I execute. There was a bunch of code that I needed to adjust as I was reaching my sense of PERFECTION! Plus, I didn’t really use a template to begin with.

There were plenty of times where I needed to take a break, but I was so eager to finish this challenge. Nothing could stop me! I’m the kind of person that sees their goal to the end. That’s what’s fun!



## HTTPS/DOMAIN TIME

There wasn’t much to setting up my website. All I needed to do was obtain a domain name, make sure my S3 bucket name is similar to my website name, provision a SSL certificate for HTTPS requests, and then create cloud front distribution to connect everything.

Here is an idea of how the architecture looks like:

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xj0ga79azcb17a6t9j02.png)


I had finished my static web documents, loaded them to the S3 bucket, made it public, and had my website up and running!




## ONE TABLE FOR MR. LAMBDA & MRS. API

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xfj888s6cfur3cf1umb0.gif)

I had great energy after completing almost half of the instructions. Then the rest of the steps hit me pretty hard. Creating the Dynamodb table was easy. Getting my API and LAMBDA function to work was where I struggled a bit.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i3o8wthz3izr3e38jku4.gif)

Working with Lambda/python was a humbling experience. I kept getting an issue with my code not allowing my return statement to parse my counter in json. My counter would always be in a decimal format. I also couldn’t get my table to update. I wasn’t all too familiar with python, so I had to take a quick crash course on the language. This typically involves me watching a lot YouTube videos on my breaks. Luckily, I was able to join the Cloud Resume Discord and get some insight on some of the mistakes I made.


I eventually got my API, Table, and Lambda function to work with one another. It was funny. Earlier, I did some research to find out what stumped people during this portion of the challenge. A good amount of them said setting up Cross-Origin Resource (CORS) was an issue. This whole time I thought I believed my issue was CORS. Come to find out, my javascript was what caused me a huge headache. My CORS setup was perfectly fine! You live and learn I guess.



## AUTOMATIC SUPERSONIC

All that was left was to create my Infrastructure as code. The Amazon White Pages were of great help. The instructions mentioned AWS SAM. This was a pretty cool portion of the challenge. I wasn’t too familiar with SAM, but it came out to be a very handy tool. The whole concept behind SAM is to create your Infrastructure through code, YAML,  and not manually provision your AWS resources.

I noticed that I already had pieces to the puzzle, but not all the pieces. When I created my resources (API, Table, Lambda), I created them through the console. I learned real quick that this wasn’t ideal. There were multiple times where I tried to import my existing resources onto CloudFormation and somehow twist that into a SAM template. I eventually learned that this wasn’t the best decision. After reading the white pages and several templates, I eventually scrapped my old resources and was able to transform my resources into code.

All that was left was to create my CI/CD pipelines. One for my frontend code and another for my backend. I did this through Github Actions. Which by the way is awesome! I was able to get templates through the Github Actions marketplace, fine tune them, and automatically push my code through my repositories.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mprff847mhdobde3qerv.gif)

## FINAL THOUGHTS

I genuinely felt great every step of the way. There were plenty of hurdles I had to over come. Some harder than others. Believe me when I say this, It was absolutely worth the struggle.

If I had to to some up a few lessons I’ve learned, it would be the following:
	1. Do your due diligence. Study the ropes.
	2. You don’t know everything out there. It’s okay to ask for help sometimes.
	3. Learn to back track. Find out what you could have done better!
	4. Enjoy the process! It’s fun.