Skip to main content
0.22 is the first release of CDK Terrain (cdktn), the community continuation of CDK for Terraform (cdktf).
The goal of this first release was to rename the project (old packages are deprecated) and to do this with minimal impact to any existing consumers of the project.

Migration Process

CLI

The cdktn cli should be fully compatible with existing CDK for Terraform projects for at least v0.22.

Project Impact

1. Update package.json dependencies:
2. Update imports:
3. Update npm scripts:
4. Reinstall dependencies:

What Stays the Same

The following items are unchanged and backward compatible:

Transitional Period (Dual Dependencies)

If you use prebuilt providers that haven’t been updated to @cdktn/provider-* yet, you may temporarily have both cdktf and cdktn installed:
This is partially supported but not recommended long-term. You may run into type errors depending on your usage.
Such as:
This is a result of types not matching (one is cdktf (referenced by cdktf providers) and the other is cdktn).
Depending on your language / package manager you may be able to resolve temporarily until cdktn providers are available.
Using pnpm it would look like:
It may also be possible to specifically reference the cdktf version of a type temporarily. For example:

Bundle Size Impact

When both packages are installed:
  • Bundle size: Approximately 2x larger (both packages included)
  • Tree-shaking: Bundlers will remove unused exports, reducing actual impact
  • Shared dependencies: constructs is deduplicated between packages
Complete migration promptly to reduce bundle size and complexity.

Options

  1. Wait: Use @cdktf/provider-* until @cdktn/provider-* is released
  2. Generate locally (Recommended): Use cdktn get to generate provider bindings without prebuilt packages
Generating provider bindings for larger providers uses a significant amount of memory (up to 16GB).

Verification

After migration, verify your project works:

Troubleshooting

Ensure you’ve updated ALL imports. Search for remaining cdktf references:
If a prebuilt provider requires a specific cdktf version:
  1. Check if @cdktn/provider-* version is available
  2. If not, use cdktn get to generate local bindings
If you see state drift after migration, verify:
  1. Internal symbols were NOT changed (they should still be cdktf/*)
  2. Logical IDs were NOT changed (still __cdktf_*)
  3. Run cdktn diff to see actual differences

Getting Help