Next, we’ll install the Terraform CLI. Terraform is a command-line utility which allows you to apply the Terraform CDK generated configurations.
You may use tenv to manage multiple versions of terraform
or OpenTofu.
Follow the installation instructions for your operating system.
Using tenv
, download terraform 1.7.3 with the following command.
tenv terraform install 1.7.3
You can check the terraform version:
$ terraform --version
1.7.3
When usingtenv
, best practice to setTERRAFORM_BINARY_NAME
environment variable for CDKTF CLI.
export TERRAFORM_BINARY_NAME=$(which terraform)