AWS

Using semantic-release with AWS CodePipeline and CodeBuild

Here is the usual pattern of getting the source from a git repository in AWS CodePipeline. In the pipeline, we use AWS CodeStart to connect to a repo and get the source. Then, we pass it to the other stages, like deploy or publish. For some unknown reasons, CodePipeline downloads …

AWS

What You Need To Know About SAM Templates

AWS SAM template is a thin abstraction of a CloudFormation template to develop and deploy lambda by a AWS tool, SAM (Serverless Application Model). It has shorter syntax compared to writing infrastructure as code with CloudFormation. We still do a little bit of learning when it comes to writing SAM …

AWS

AWS re:Invent 2020 Keynote by Andy Jassy

AWS re:Invent is always exciting and inspiring. Because of the pandemic, this year’s re:Invent is 100% online. I watched the keynote speech and took a memo. There is no mind-blowing new services this year (like the equivalent of announcing Lambda or SageMaker). It feels like they are building more capability …

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 …

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 …

AWS

How to Solve ‘Missing Authentication Token Error’ with API Gateway Custom Domain

After setting up everything correctly, you may have ‘Missing Authentication Token Error’ when you call the custom domain while the endpoint from API gateway works. Surprisingly, this is one of the most common errors I have seen, yet not very well documented. So, here it is. When you encounter this …