terraform apply and terraform destroy directly, but we recommend using the available cdktn cli commands where possible.
Install
Use
CI Environment
If you are running the CLI in an automated environment, you can force the dynamic CLI output rendering to be static by setting theCI environment variable to true.
Configuration File
You can configure the behavior of the Terraform CDK CLI by modifying thecdktf.json file in your project root directory. Refer to the cdktf.json documentation for more detail on how you can supply custom configuration settings for your application.
Telemetry
The CDKTN CLI (cdktn-cli interacts with a HashiCorp service called Checkpoint to report project metrics such as cdktn version, project language, provider name, platform name, and other details that help guide the project maintainers with feature and roadmap decisions. The code that interacts with Checkpoint is part of the CDK Terrain CLI. The use of Checkpoint is completely optional. Refer to the telemetry documentation for more information about Checkpoint and you can disable it if desired.node-gyp errors
CDKTN CLI invokes the Terraform CLI interactively in a pseudo-terminal (PTY) for the deploy and destroy commands. This requires native code that needs to be compiled for the architecture of the system the CDKTN CLI is installed on. To make things easier, we maintain a fork that includes pre-compiled native bindings for multiple target architectures and Node.js versions. However, there is still the rare possibility, that no precompiled binary is available. In such a case node-gyp will attempt to compile the native libraries upon installation of the cdktn-cli package and will require additional software to compile the native code that might not be installed yet.
For example, you might encounter the following error when installing the CDKTN CLI:
node-gyp documentation for UNIX, Mac OS X, and Windows.
You might also encounter this message if you’re using a Node.js version for which we don’t pre-compile native code. We currently support Node.js versions 17, 18, 19, and 20. If you’re using a different Node.js version you can either install the required additional software as described above or switch your Node.js versions to a supported one.