Git

Deploying Jekyll Site to Github Page with Github Actions

I created my personal portfolio site with Jekyll. The site is simply chucked in the Github page. Now, it is time to use Github actions to deploy the site to the Github page repo every time I commit to master. Here is the code. I am not using the Jekyll …

Front-End

Dispatching Custom Events for Front End Analytics Application

When we have a web analytics application that collects front end event data such as Tealium, Adobe Analytics and so on, we can dispatch an custom event whenever user does action on the page. For example, we can dispatch a custom event to indicate the user clicked certain button on …

AWS

How to Run Lambda Function Every 30 Seconds

To schedule a lambda function to run at a regular interval, we can use CloudWatch Events. The problem is that the shortest interval is 60 seconds with CloudWatch Event scheduled job. What if we want to run a function under 60 seconds interval? Using a sleep function to loop the …

Node.js

JavaScript Workout

I made a JavaScript workout with a md file in my GitHub repo. Check out the work out here. The idea of this is to list a short JavaScript programming questions that you would encounter every day as a JavaScript developer. If you know how to do these, you don’t …

AWS

AWS CDK ERROR: There is already a Construct with name ‘XYZ’

When I was running AWS CDK, I got this error and couldn’t really find the answer when I googled it. This error might happen for different reasons, but I worked out what was wrong with my CDK code after a few hours of googling and trying out different things. I’m …

AWS

How To Optimise Memory Allocation For Lambda Functions

In terms of computing, the lambda has only one parameter to tune, memory allocation. We can allocate any amount of memory between 128MB and 3008MB to your function today. The amount of memory you allocate is proportional to the amount of CPC allocated for the function. The lambda pricing is …

AWS

Getting Started with AWS CDK with TypeScript

There is something really delightful about using actual programming language to code infrastructure. AWS CDK allows us to write infrastructure code in a totally different way from writing YAML or JSON type of code like CloudFormation or Terraform. The infrastructure code feels more familiar and it is more fun if …

AWS

Deploying Static Website to S3 with AWS CodeBuild

There are a few AWS devops services, CodeDeploy, CodeBuild and CodePipeline. They have similar name and it’s confusing at first. CodeBuild is the service to create an artefact. In CodeBuild, we can install dependencies, run unit tests, create an artefact and push to the artefact repository. CodeDeploy uses the artefact …

AWS

Deploying Multi-Container Applications to AWS Elastic Beanstalk

The easiest way to deploy containerised applications to AWS is to use Elastic Beanstalk. Instead of creating and managing individual resources (such as EC2, security groups, load balancer, RDS and so on) to run applications, it creates and manage them as environments. If you want to deploy containers to AWS …

Infrastructure

How to Persist Data in Local DynamoDB Docker Container

Having DynamoDB running locally is handy for local development. There are two ways to run DynamoDB locally, (1) using a jar file or (2) using a docker image. Generally speaking, running container is better than running a jar file in your local computer because it gives you more flexibility and …