browse
cdktf/CDK for Terraform CLI
HashiCorpDefine infrastructure using familiar programming languages with CDK for Terraform.
Infrastructure as Code
01Agent Notes
cdktf wraps Terraform with programming language support. Key commands: init (scaffold), synth (generate HCL), deploy (apply), destroy, diff (plan). Runs `terraform` under the hood. Use `cdktf synth` to generate Terraform JSON, then inspect with terraform commands for structured output.
02Global Flags
| Flag | Type | Description |
|---|---|---|
--log-level | enum [debug, info, warn, error] | Logging verbosity level |
--no-color | boolean | Disable color output |
03Authentication
Methods
environment-variablesconfig-file
Env vars
TF_VAR_*CDKTF_LOG_LEVELConfig files
~/.terraformrcSetup
cdktf init04Install
npm install -g cdktf-cli05Capabilities
Reference
binary
cdktfcheck
cdktf --versionauth
environment-variables, config-fileformats
textversion
0.21.0