Skip to main content
CDK Terrain v0.25.0 finishes the move to declared target versions. Four features that used to be checked against the Terraform binary on your PATH are now checked against the targetVersions in cdktf.json (cdk-terrain#453, #454, #455, #456). With those moved, synthesis never runs terraform or tofu to validate features (#457). This is a breaking change. To upgrade, follow the v0.25 upgrade guide.

What changed

Four features validate against targetVersions

Before v0.25, synthesis ran the installed binary to check its version when you used one of these features. Now synthesis compares the feature’s minimum version with your declared range: As with function availability, the feature must be supported across the whole declared range of every product you target. If you don’t declare targetVersions, CDKTN checks against Terraform >=1.5.7 and OpenTofu >=1.6.0, and all four features pass. A project that declares a Terraform floor below a feature’s minimum now fails synthesis when it uses that feature. For example, with "targetVersions": { "terraform": ">=1.4.0" }, a resource move fails:
To fix it, raise the floor of the declared range to the version in the table, or stop using the feature. See Declare Target Runtimes.

Synthesis no longer runs a binary

The same cdktn synth gives the same result in CI, in package builds, and on a machine without Terraform or OpenTofu. Your installed binary no longer decides whether synthesis passes. To check the installed binary as well, set validateInstalledBinary in cdktf.json. The commands that run the binary then fail if it’s outside your declared targetVersions. See Validate the Installed Binary.

ValidateBinaryVersion and ValidateTerraformVersion are removed

The validations that ran the binary are deleted. The cdktn package root never exported them, so this only breaks code that deep-imported them from inside the package. Use the declared targetVersions instead.