How To Install

Prerequisites

  • Terraform CLI 1.1+

  • Node.js and npm v16+

  • Programe Lang

    • TypeScript v4.4 and Node.js v16.13

    • Python 3.7 and pipenv v2021.5.29

    • Go v1.16

    • C# .Net Core Runtime v3.1

    • Java OpenJDK V17 and Aapche Maven v3.8.4

Install

  • npm - Stable Release

npm install --global cdktf-cli@latest
  • Homebrew - Stable Release

brew install cdktf

==> Downloading https://ghcr.io/v2/homebrew/core/icu4c/manifests/71.1
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/icu4c/blobs/sha256:0bf3c66f005e2d7662375b4baadd3022d57294947f421f9f8628799008a987f4
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:0bf3c66f005e2d7662375b4baadd3022d57294947f421f9f8628799008a987f4?se=2022-10-03T14%3A05%3
######################################################################## 100.0%
.
.
.
.
==> Installing cdktf
==> Pouring cdktf--0.12.2.arm64_monterey.bottle.tar.gz
==> Caveats
zsh completions have been installed to:
 /opt/homebrew/share/zsh/site-functions
==> Summary
🍺  /opt/homebrew/Cellar/cdktf/0.12.2: 8,475 files, 162.7MB
==> Running `brew cleanup cdktf`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
==> Caveats
==> cdktf
zsh completions have been installed to:
 /opt/homebrew/share/zsh/site-functions

Verify

cdktf help
cdktf

Commands:
 cdktf init                Create a new cdktf project from a template.
 cdktf get                 Generate CDK Constructs for Terraform providers and modules.
 cdktf convert             Converts a single file of HCL configuration to CDK for Terraform. Takes the file to be converted on stdin.
 cdktf deploy [stacks...]  Deploy the given stacks                                                                                                          [aliases: apply]
 cdktf destroy [stacks..]  Destroy the given stacks
 cdktf diff [stack]        Perform a diff (terraform plan) for the given stack                                                                               [aliases: plan]
 cdktf list                List stacks in app.
 cdktf login               Retrieves an API token to connect to Terraform Cloud or Terraform Enterprise.
 cdktf synth               Synthesizes Terraform code for the given app in a directory.                                                                [aliases: synthesize]
 cdktf watch [stacks..]    [experimental] Watch for file changes and automatically trigger a deploy
 cdktf output [stacks..]   Prints the output of stacks                                                                                                    [aliases: outputs]
 cdktf debug               Get debug information about the current project and environment
 cdktf provider            A set of subcommands that facilitates provider management
 cdktf completion          generate completion script

Options:
     --version                   Show version number                                                                                                               [boolean]
     --disable-plugin-cache-env  Dont set TF_PLUGIN_CACHE_DIR automatically. This is useful when the plugin cache is configured differently. Supported using the env
                                 CDKTF_DISABLE_PLUGIN_CACHE_ENV.                                                                                  [boolean] [default: false]
     --log-level                 Which log level should be written. Only supported via setting the env CDKTF_LOG_LEVEL                                              [string]
 -h, --help                      Show help                                                                                                                         [boolean]

Options can be specified via environment variables with the "CDKTF_" prefix (e.g. "CDKTF_OUTPUT")