
Member-only story
Getting Started with Cloud Development Kit for Terraform (CDKTF)
The Cloud Development Kit for Terraform (CKDTF) is a tool that allows us to write IaC in native languages such as Typescript, Go, Python, and others.
It allows us to write infra in the everyday language we prefer, which means we can harness the benefits of the features and development workflows.
IntelliSense support for languages like Typescript, Python, and others is an excellent illustration. As we type, it displays autocomplete suggestions.

What powers CDKTF?
CDKTF was developed in collaboration with AWS Cloud Development Kit (CDK) and HashiCorp Terraform by leveraging two key technologies of the AWS CDK, which are listed below:
CDKTF workflow
Given below is a visual representation to illustrate the workflow of CDKTF:

How does CDKTF work?
To understand how CDKTF works without the hassle of setting up any cloud provider accounts, we will be provisioning an ‘nginx’ docker container on our local machine through CDKTF.
Prerequisites
- Install the
cdktf-cli
package through npm.
npm install --global cdktf-cli@latest
- Install ‘docker’ if not already installed.
Getting started
- Create a new directory and initialise a typescript (or any other language you are familiar with) based
cdktf
project.
mkdir cdktf-learn-starter # Create a new directory
cd cdktf-learn-starter # Change directory to
# cdktf-learn-starter
cdktf init --template=typescript --local # Initialise a template…