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
cdktn cli should be fully compatible with existing CDK for Terraform projects for at least v0.22.
Project Impact
- TypeScript/JavaScript
- Python
- Go
- Java
- C#
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:
cdktf (referenced by cdktf providers) and the other is cdktn).
Using pnpm it would look like:
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:
constructsis deduplicated between packages
Options
- Wait: Use
@cdktf/provider-*until@cdktn/provider-*is released - Generate locally (Recommended): Use
cdktn getto generate provider bindings without prebuilt packages
Verification
After migration, verify your project works:Troubleshooting
"Module not found" errors
"Module not found" errors
Ensure you’ve updated ALL imports. Search for remaining
cdktf references:Provider version conflicts
Provider version conflicts
If a prebuilt provider requires a specific
cdktf version:- Check if
@cdktn/provider-*version is available - If not, use
cdktn getto generate local bindings
State drift after migration
State drift after migration
If you see state drift after migration, verify:
- Internal symbols were NOT changed (they should still be
cdktf/*) - Logical IDs were NOT changed (still
__cdktf_*) - Run
cdktn diffto see actual differences
Getting Help
- Ask question in the cdk.dev Slack
- GitHub Issues: https://github.com/open-constructs/cdk-terrain/issues