I have heard the term CDKTF twice in the last two weeks. For those that are not familiar with it, CDKTF is the Cloud Development Kit for Terraform. It allows developers to define infrastructure resources using familiar programming languages like TypeScript and Python, leveraging the power of Terraform to manage cloud resources. CDKTF provides a higher-level abstraction, simplifying the creation and management of complex cloud infrastructure while maintaining the benefits of Terraform's infrastructure-as-code approach.
I did a bit of googling and read a few pages. This definitely looks interesting. I am working my way through the prerequisites so that I can start tinkering. As usual, I will be starting with a Rasberry Pi running Ubuntu. The first prereq is Terraform. I already had that one so I will bounce to the next step. If you need them you can find the steps to install Terraform on the Hashicorp website.
My next step is to install the CDKTF toolkits. This requires npm
, which is something that frequently appears and disappears from my environments. It is a quick install.
sudo apt install npm
npm install --global cdktf-cli@latest
My last step to complete the prereqs is to pick a language.. CDKTF currently supports five development languages (TypeScript, Python, Java, C#, and Go). Each language has its own pros and cons. I will not go into any of that here. Of all the languages in the list, I am most comfortable with Python for my personal use. In a professional setting, I could also with TypeScript or Go since I have exposure to these. I have been using python3 -m venv
for so long this was something new for me. I installed this with apt as well. If your OS does not have a package, you can always install with pip.
pip install --user pipenv
I am running through the Python quick start demo and the examples. I had to install the Docker and AWS providers using pipenv.
pipenv install cdktf-cdktf-provider-docker
pipenv install cdktf-cdktf-provider-aws
Most of the Python examples are somewhat basic, and they are targeted at the common cloud platforms.
For my personal projects, the standard HCL is more than sufficient for my needs; however, I can definitely see the benefits of using Python to build infrastructure. While this does add another layer of complexity, it does allow a platform team to add more fine grain controls to their infrastructure deployments.
On a side note, while googling for other providers, I kept running across ads for Vultr. I might have to try them out one day.