Obaro's Blog

Obaro's Blog

Serverless Online Profile on AWS

Serverless Online Profile on AWS

In the past couple of days, I worked on building an online profile for myself partially guided by the #CloudResumeChallenge requirements. I highly recommend it.

Here's what I have done:

  1. Online profile using HTML, JavaScript and CSS. The was the boring part for me and I googled and borrowed ideas from existing themes. CI/CD was done using Github Actions, which I really connected with coming from a CircleCI and Jenkins background, Of course the IAM credentials I used in Github Secret is limited to exactly what it needs to talk to my S3 bucket and CloudFront distribution. See code.

  2. Online profile infrastructure, meaning the S3 bucket, Route53 records, CloudFront Distribution. This is where I shine. I did this all in Terraform. Super proud of this because midstream I decided to change my domain name, and all I had to do was a terraform apply to recreate everything afresh (em ... not exactly though, I had to first empty the s3 bucket). See code.

  3. Online profile API, including Lambda, DynamoDB, REST API Gateway and the Python code. I really spent time thinking on what direction to take for this one: AWS SAM, CDK, Serverless Framework or my true love, Terraform. Well, you can guess what I went with. Everything was implemented in Terraform, except for the actual lambda function code in Python, and once again, it requires only two commands to tear it all down and bring it back up again (I love this!). Unit tests for the Lambda function code was also written in Python with the help of pytest and moto (powerful library), with CI using Github Actions. See code.

You can see what the site looks like here.

#aws#terraform#serverless#cloud
 
Share this