Terraform CDK (CDKTF) with TypeScript
Advanced · 45 minutes · 100 points
In this advanced lab, you will install and configure the Terraform Cloud Development Kit (CDKTF) with TypeScript, define infrastructure as code using TypeScript classes, synthesize Terraform JSON configuration, and explore the CDKTF workflow. You will build a foundational CDKTF project from scratch, understanding how high-level TypeScript constructs map to Terraform resources.
What you’ll learn
- Install and verify the CDKTF CLI and TypeScript toolchain inside the lab environment
- Scaffold a new CDKTF TypeScript project and understand its directory structure
- Define a Terraform null_resource using TypeScript CDKTF constructs and synthesize it to Terraform JSON
- Add a local_file resource to the CDKTF stack and verify the synthesized Terraform configuration
How this lab works
- Start the lab: One click starts a container on your computer with a real terminal: nothing to install by hand, nothing to clean up.
- Work through 4 tasks: Each task says what to build or fix. You do it yourself, in a real terminal, with hints when you get stuck.
- Check your work: Check my work runs each task’s checks in your container and says what passed and what to fix.
- Finish and keep going: 100 points, your progress saved, and the next lab to try.
What it runs on
- Runs: A container on your computer, with a real terminal
- Image: node:20-bookworm
What you need
- A free LearnXops account
- The LearnXops desktop app for macOS, Windows or Linux
- Docker Desktop installed and running
Topics: cdktf, terraform, typescript, iac, infrastructure-as-code, null-provider, local-provider, nodejs
Create a free account to start this lab.