Cloud Resume Challenge - AWS
Tags: aws, cloud
Published: 2021-10-27 20:52:55

## Background
I stumbled upon the [Cloud Resume Challenge](https://cloudresumechallenge.dev/docs/the-challenge/aws/) while preparing myself for the AWS Certified Solution Architect exam. I already passed the Cloud Practitioner and was looking for some hands-on labs or challenges to get my hands *cloudy*...
![cloudy-hands](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5jxmkk1i78tk88ttfqul.gif)

I've come up with my own challenge [100 days in Cloud](https://cloudofthings.net/category/aws-labs/) during which I go through one lab a day and describe how I solved it. But I needed a bigger project that would demand some more digging and sweating to accomplish, hence the CRC. 
### Challenge instructions:
 :heavy_check_mark: **Certification**  - got [my](https://www.credly.com/badges/5aab882a-2ced-4a72-9bcd-e92d8b99f1e5) AWS Certified Cloud Practitioner
 :heavy_check_mark: **HTML**  - check [my profile](https://myprofile.cloudofthings.link/
 :heavy_check_mark: **CSS**  - [style.css](https://github.com/CloudedThings/aws-crc-sam/blob/main/website/style.css)
 :heavy_check_mark: **Static Website** - AWS SAM [template](https://github.com/CloudedThings/aws-crc-sam/blob/main/template.yaml) takes care of that
 :heavy_check_mark: **HTTPS**  - Amazon CloudFront takes care of that
 :heavy_check_mark: **DNS**  - Route 53 points to my profile page as part of [cloudofthings.net](https://cloudofthings.net/)
 :heavy_check_mark: **Javascript**  - there's some script in [script.js](https://github.com/CloudedThings/aws-crc-sam/blob/main/website/script.js) and in index.html
 :heavy_check_mark: **Database**  - DynamoDB deployed using SAM
 :heavy_check_mark: **API**  - similarly here
 :heavy_check_mark: **Python** - [Lambda functions](https://github.com/CloudedThings/aws-crc-sam/blob/main/get-function/app.py) 
 :heavy_check_mark: **Tests** - Integration and [End-to-end](https://github.com/CloudedThings/aws-crc-sam/blob/main/tests/end-to-end-test/index.js) tests in [GitHub actions](https://github.com/CloudedThings/aws-crc-sam/blob/main/.github/workflows/deploy.yml)
 :heavy_check_mark: **Infrastructure as Code** - AWS SAM [template](https://github.com/CloudedThings/aws-crc-sam/blob/main/template.yaml)
 :heavy_check_mark: **CI/CD** - [GitHub actions](https://github.com/CloudedThings/aws-crc-sam/blob/main/.github/workflows/deploy.yml)
 :heavy_check_mark: **Blog post** - obviously... :smirk:

---
![diagram](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qf33ynicchio7uwylizo.jpg)
---
## My challenge experience
I started with creating a sample HelloWorld application using SAM. This way I got Lambda with API Layer as a starting point for my infrastructure. Not everything went smoothly as one might have wished for so I'll focus mainly on my greatest challenges and solutions that thought me something new.

An example of an issue I got stuck on was when making the bucket accessible for the CloudFront distribution so I've decided to make my website bucket private and used CloudFront Origin Access Identity. It somehow felt more secure as well, so win-win situation even though it drove me crazy not being able to figure out what's blocking CloudFront access to the previously public bucket. 

Creating the ACM Certificate and attaching it to my CloudFront. I live in Sweden and I thought it's only logical to use resources nearby and to find out if there are any services that I won't be able to use. And Certificates for CloudFront distribution happen to be an example of that. Since CloudFront uses certificates created only in the us-east-1 region I had to create one in AWS Console and use its ARN in the template. I suspect that there is a pure IaC-ish type of solution but this one works too.

The most giving lesson from the challenge was the CI/CD with GitHub Actions. What I revelation that was. Even though that I used [Live Server extension for VSC](Live%20Server%20extension%20for%20VSC) - which I strongly recommend - I was struck by how easy it is to upload and deploy your code with Actions. When I set up my Workflow to use AWS SAM it builds and deploys changes in the infrastructure. Similarly for the website contents making the pushes would trigger the upload of the website content.

Working on the backend consisting of **API Gateway**, **Lambda**, **DynamoDB** was relatively easy since I've done it many times. Here I've learned that you can easily increment values in tables using update expression.

Another challenging part was to write a SAM template, getting the syntax right, using **!Ref** and **Fn::Sub** functions. But it was a great practice. Infrastructure as Code feels like the only way to design and deploy resources in AWS.

---

## Summary
I got so much out of this Challenge! I needed that kind of project to get my head around all of the things I've been learning recently while preparing for the Solution Architect Associate exam and put my skills into action. I wrote two separate posts on my blog detailing the steps I took, so if you are curious have a look at the [first](https://cloudofthings.net/lab-70/) and [second](https://cloudofthings.net/lab-76/) one. 
 
 ---

### Additional notes
{% github CloudedThings/AWS-Cloud-Resume-Challenge-SAM no-readme %}

Check my website if you’re looking for inspiration on AWS [hands-on labs](https://cloudofthings.net/category/aws-labs/).