This is why I think AWS CDK is the best thing


Hey, do you know that there’s something called AWS CDK and it’s literally amazing?

I used CloudFormation before to build the infrastructure for my blog behind a load balancer (yes the very same blog you’re reading this article on right now).

CloudFormation was neat but painful, files became very big and complicated, and it takes forever to make changes and deploy them.

I use GitHub Actions to automatically deploy the new template when I push a change to the codebase (you can actually see it at github.com/ammaratef45)

I then knew about AWS CDK and how you can write the infrastructure as TypeScript code (or python, c#, go, and other languages they support)

I was amazed by the idea but didn’t have a chance to try it (I hate having to migrate a stable and working piece of software) until I was contributing to the infrastructure of another project, a discord bot for the werewolves game

I decided to learn and use CDK for the infrastructure and it was a blast, it took me way less time (I’d say fifth the time or even less) to build and tune the infrastructure.

Before deploying I can run cdk diff to see the changes before applying them, I only need to run cdk deploy to apply the changes 🤩

The autoscaling group, dynamodb, security groups, codedeploy app, and deployment groups are all one simple file of code (less than 100 lines)


Leave a Reply

Your email address will not be published. Required fields are marked *