Running terraform init -migrate-state via CDKTF

Possible workarounds:

  1. Once the .tf.json is generated by cdktf synth or the .tf file by cdktf synth --hcl, you can use the plain old terraform command line interface with it. Just change to the directory it’s in and run terraform init -migrate-state. Here’s an example explanation for changing directory and running terraform import: How to import already created AWS resources in TF CDK - #11 by DanielMSchmidt

  2. You may be able to find the difference in the backend configuration and remove it if it’s unnecessary. I used .add_override() recently to get to CDKTF first, and migrate state later.

I use CDKTF extensively as a Python to HCL conversion library but stick with terraform on the command line (I don’t think it’s broken or in need of replacement).