DEV Community

mattspath
mattspath

Posted on

Cloud Resume Challenge – AWS

I obtained my AWS Cloud Practitioner certification a few months ago and recently discovered the Cloud Resume Challenge on Reddit. This seemed like a great opportunity to familiarize myself with Infrastructure as Code (IaC), Lambda, Unit Testing, and CI/CD Pipelines, all of which were new but interesting to me.

While completing this challenge, I encountered obstacles that required some troubleshooting and a bit of trial and error, but getting everything working was so satisfying. I completed the steps of the challenge out of order, using Github for Source Control early in the project to manage and track my files as I made changes.

After I completed my Resume and had the static website available via HTTPS, I moved onto Infrastructure as Code, using AWS SAM, instead of making the Database, API Gateway, and Python Lambda function by themselves through the AWS Console.

AWS Cloud Resume Challenge Diagram

Challenge Steps/Instructions:

My experience

I started by finding an HTML resume template, updating it with my resume details. Creating the S3 bucket and uploading the files was easy and straightforward, as was enabling static website hosting. Configuring the S3 bucket permissions is where I encountered my first obstacle: properly configuring permissions to allow access while maintaining bucket security. I discovered that I could use an Origin Access Identity to provide CloudFront access to my S3 bucket.

I used Route 53 to register my domain, Mattspath.com, and to create an A record to point to my CloudFront Distribution. Once I had my FQDN identified, I was able to request a TLS certificate using AWS Certificate Manager (ACM) and reconfigure CloudFront to redirect HTTP to HTTPS and use the certificate that was generated.

While searching how to get the visitor counter set up, I came across Amazon Serverless Application Model (SAM). Using SAM, I was able to create and deploy a template file to provision my DynamoDB table, API Gateway, and Lambda Python function. The SAM template is how I implemented Infrastructure as Code (IaC). Once I got my backend set up, I found a Javascript example to use to make the API call which increments and retrieve the visitor count. Once I added that to my HTML page, I wrote some basic unit tests in Python.

Setting up CI/CD Pipelines for both front end and back end environments was the only remaining tasks. I opted to use Github Actions to facilitate this, which was possibly one of the most insightful parts of this project, as I had only ever used Github to host my repositories and for version control. Setting up Github Secrets to hold AWS Region, S3 Bucket, and AWS role values confidentially was a must. For both front end and back end workflows, I used ubuntu and configured them to pull my repo and set up AWS credentials. The front end workflow copies the contents of the website directory to my S3 bucket, updating my static resume website. The back end workflow installs python, boto3, runs my test file, then validates, builds, and deploys my SAM template to AWS.

Conclusion

This project was a lot of fun and allowed me to get practical experience with new services and features. Getting hands on with SAM to deploy Lambda, API Gateway and DynamoDB resources was insightful, as I move more towards automation and implementation of IaC within AWS. Learning how to use Github Actions to automatically test and push that SAM configuration on commit to the master branch is something that will also help me set up CI/CD pipelines to better enable that automation. This experience has left me excited to try different things in AWS, and hopefully pursue additional challenges in the future to gain more experience.

Additional Notes

Github Page - mattspath/cloud-resume-challenge

Top comments (0)