Prerequisites
- A project on CDKTN 0.24.x. If you’re on an earlier version, follow the v0.24 upgrade guide first.
- Node.js 22.23.4 or later.
- Python 3.10 or later, if your project uses Python.
Breaking Changes
Node.js 22.23.4 minimum
cdktn-cli now requires Node.js 22.23.4 or later, the 22.x release with the
October 2026 Node.js security fixes. This applies to every project language,
because the CLI runs on Node.js. Update your local environment and CI before
you upgrade:
Python 3.10 minimum
Thecdktn 0.25.0 package on PyPI requires Python 3.10 or later
(requires_python >=3.10); 0.24.0 accepted Python 3.9. Python projects must
run on Python 3.10+ locally and in CI before upgrading:
Moved, import, terraform_data, and cloud validate against targetVersions
Synthesis now checks these features against the targetVersions in
cdktf.json instead of the Terraform binary on your PATH:
If you don’t declare
targetVersions, CDKTN checks against Terraform
>=1.5.7 and OpenTofu >=1.6.0, and all four features pass. You only need
to act if you declare a range whose floor is below a feature you use.
-
Open
cdktf.jsonand findtargetVersions. Projects created withcdktn initsince v0.23.4 declare the defaults: -
Run
cdktn synth. If it fails with a message such asThe moved block requires terraform >=1.5.0, but the project targets terraform >=1.4.0, raise the floor of that product to the version in the table, or stop using the feature. Each key takes an npm semver range. Leave out a product you don’t deploy with. See Declare Target Runtimes. -
Synthesis no longer notices when the installed binary is older than your
declared range. To keep that check, set
validateInstalledBinaryso the commands that run the binary verify it first. See Validate the Installed Binary.
ValidateBinaryVersion and ValidateTerraformVersion removed
These classes are deleted. They were never exported from the cdktn package
root, so this only affects code that deep-imported them from inside the
package. Remove those imports. To validate a feature
against the project’s targets, rely on targetVersions. To check the
installed binary, use validateInstalledBinary.
Asset API changes
CustomIAssetPackaging implementations must add two required members:
omitsDirectoryEntries must match what pack() writes, or the asset hash and
the artifact describe different file sets. The built-in zip packaging sets it
to true, because its archives contain no directory entries.
Custom assetHash values may only contain letters, digits, _, ., and
-, because the hash becomes part of the staged asset’s path. Sanitize values
built from branch names or paths:
TerraformAsset.assetHash is read-only. Java, C#, Python, and Go lose the
setter. Pass assetHash when you create the asset instead of assigning it
afterward.
Deprecations
--cdktf-version
cdktn init --cdktf-version still works but prints a warning. Replace it with
--cdktn-version in scripts and CI:
Yarn
Projects that use Yarn, classic (1.x) or Berry (2+), print a one-time deprecation warning. Move them to npm or pnpm. On Yarn Berry,provider list,
provider upgrade, and debug fail with a usage error. See
TypeScript package managers.
Telemetry changes
The CLI no longer sends data to HashiCorp Checkpoint. It reports aggregated usage metrics to the CDKTN project’s Sentry, behind a newsendUsageTelemetry flag in cdktf.json:
- On your first interactive run after the upgrade, the CLI asks once about
each consent flag that’s missing from
cdktf.jsonand saves your answers. This includessendCrashReports, which earlier versions never asked about when the key was missing. - In CI, or when input or output is piped, the CLI never asks. Usage metrics stay on unless you opt out, and crash reports stay off.
- To opt out, set
"sendUsageTelemetry": falseincdktf.json, or setCHECKPOINT_DISABLEto any non-empty value.
Upgrade Process
- TypeScript/JavaScript
- Python
- Go
- Java
- C#
1. Ensure Node.js 22.23.4+:2. Check your pre-built providers:3. Bump the cdktn packages in package.json:CDKTN 0.25 supports Bump each 5. Optional: move to TypeScript 6. Your project keeps working with
In TypeScript 6 no longer loads ambient tsx doesn’t type-check, so
constructs ^10.6.0 again, so you can lift a
<10.8.0 cap you added for 0.24.@cdktn/provider-* package to its major for 0.25 as well.4. Reinstall and verify:ts-node on TypeScript 5. ts-node doesn’t support TypeScript 6, so if you
move to it, run the app with tsx as new projects do:cdktf.json:@types packages automatically, and
ts-jest needs isolatedModules on TypeScript 6. Add both to
tsconfig.json:cdktn synth no longer reports type errors. Run
npx tsc --noEmit or npm run build in CI.cdktn get, regenerate them
with the 0.25 CLI. In a project that targets only OpenTofu, the documentation
links in the bindings now point to the OpenTofu Registry. See
Registry-Aware Provider Resolution.
What Stays the Same
Thecdktf.json file name, the output directory (cdktf.out/), CDKTF_*
environment variables, Terraform provider sources you already wrote, and your
Terraform state are unaffected. Assets that don’t use the new options keep
their hashes.
Verification
After upgrading, confirm your project still synthesizes:Getting Help
- Ask a question in the cdk.dev Slack
- GitHub Issues: https://github.com/open-constructs/cdk-terrain/issues