"Set it and forget it?" With Infrastructure-as-Code (IaC), this can be easily achieved, and with the appearance of cloud technologies (e.g. Amazon AWS, Microsoft Azure, Google Cloud Platform,...), it is a great time to present your dream app to the rest of the world. In this post, I will do a quick walk through of my journey to create my cloud resume, following Forrest Brazeal's Cloud Resume Challenge (CRC). My aim is to make my application as easy as possible to deploy and troubleshoot, while keeping security in mind.
First things first, here is the diagram of the complete app (created via AWS CloudFormation Designer):
Let's begin!
To set off on the right foot, I followed CRC's recommendation to use org-formation for creating the structure of my AWS organization. It uses AWS CloudFormation, a tool that automates the creation of your cloud infrastructure using IaC defined in JSON or YAML. This is used along with AWS CodeBuild, CodePipeline for Continuous Integration/Continuous Delivery (CI/CD). This is the thing I love most about IaC - the ability to create and re-create sophisticated infrastructure using simple values defined by you, only written down once, but can be easily modified when the application's needs change.
Then, it was time to show my resume to the world. I chose GitHub as my resume's code repository, which was written with HTML and CSS. Then I made a decision to use CloudFormation templating language for the infrastructure of my resume. At this point, I would like to emphasize that for every resource in my CloudFormation template, I have created it at least once manually and decided that it's integral to the app's operation. This is to ensure that I don't create more resources than I need to, which I believe leaves little in terms of security concerns, also keeps costs down, and less things to look at when you need to troubleshoot an issue with the infrastructure. The resume is hosted in an AWS S3 bucket, served by AWS CloudFront.
Then it was time to add the visitor counter. The counter is a client-side Javascript module attached to your resume, it increments by one for every site visit. Since I'm terrible at styling my HTMLs, I decided to set the max counter number to 100 before restarting, so as to not mess up the styling on mobile devices. The visitor counter infrastructure, which includes a backend database and alerts, was a challenge to put on a template, but it gave me a lot of insight on how AWS resources as a whole works, which paved the foundation for when I switch the template to use AWS Serverless Application Model (SAM) templating language later on.
Now that the main parts of the resume have been defined on templates, I wanted to add the final touch: CI/CD from GitHub to AWS, using GitHub Actions (GHA). GHA is an automation tool that runs the steps that you defined in a YAML file. The steps would be similar to how you would perform manually if you were to upload your resume's infrastructure to AWS from your own computer. Figuring out GHA was a challenge itself for me, but after multiple workflow runs, failures, and troubleshooting, it always gets me excited seeing that workflow run green check mark.
Finally, I decided to switch the infrastructure templates from CloudFormation to Terraform. I'm glad that I wrote it in CloudFormation first, because converting it into Terraform solidifies my knowledge and gave me confidence. Then I added some more GitHub Action workflows that'll allow me to apply and destroy the Terraform infrastructure in one place.
Thank you for reading my post!
Top comments (0)