Overview
CDKTF combines the expressiveness of TypeScript with Terraform’s provider ecosystem. Instead of authoring HCL, you’ll use TypeScript classes, types, and IDE tooling to model infrastructure as code (IaC). This lesson emphasizes practical, hands-on labs and a repeatable local development environment so you can continue practicing beyond the course.Throughout the lesson we’ll use hands-on labs for demonstrations. You’ll also get step-by-step guidance to set up the same environment locally so you can practice and iterate on your own machine.
Who this course is for
What you will achieve
By the end of this lesson you will be able to:- Explain core infrastructure-as-code concepts and where CDKTF fits in the IaC ecosystem.
- Understand why CDKTF is a strong option: use TypeScript constructs, static types, and IDE tooling to author infrastructure.
- Apply TypeScript fundamentals in the context of CDKTF projects.
- Use CDKTF to define resources, compose constructs, and apply best practices for maintainable IaC.
- Build and deploy practical AWS infrastructure including Lambda functions, IAM roles, and S3 buckets.
- Organize infrastructure code with constructs and patterns suitable for teams and long-lived projects.
Course approach
- Hands-on labs and worked examples driven by TypeScript + CDKTF.
- Incremental learning: we begin with fundamentals and progress to real-world deployments.
- Practical guidance on structuring projects, testing infrastructure code, and managing Terraform state.
Lesson plan (high level)
- Environment setup and CDKTF project bootstrapping.
- Defining resources in TypeScript and synthesizing Terraform JSON.
- Using constructs to encapsulate and reuse infrastructure patterns.
- Deploying to AWS: Lambda, IAM, S3 examples.
- Testing, local iteration, and Terraform state management best practices.
Prerequisites
- Basic familiarity with JavaScript or TypeScript.
- Recommended: a working installation of Node.js (LTS), npm or yarn, and an AWS account (for AWS labs).
- Optional: prior knowledge of Terraform fundamentals (providers, state) will accelerate learning but is not required.
When you deploy real infrastructure, manage credentials and Terraform state carefully. Use secure mechanisms like environment-specific workspaces, remote state backends (e.g., S3 + DynamoDB), and avoid committing secrets or provider credentials to source control.
What you’ll do in this lesson
- Set up a local CDKTF development environment.
- Create your first CDKTF TypeScript project and synthesize Terraform configuration.
- Deploy and test AWS resources (Lambda, IAM roles, S3) using CDKTF-generated Terraform.
- Learn patterns for organizing and testing infrastructure code using constructs.
Links and references
- CDK for Terraform (CDKTF) docs: https://developer.hashicorp.com/terraform/cdktf
- Terraform documentation: https://www.terraform.io/docs
- TypeScript: https://www.typescriptlang.org/
- AWS docs: https://docs.aws.amazon.com/