CDKTF adds random suffixes to resources inside constructs.
For example, if we have a
KubernetesCluster construct, with a
backend-cluster id, it will add a suffix to it:
When we change the name of the construct, or refactor constructs, we would like to move the terraform state to the new state to avoid recreating resources.
For example, rename
terraform state mv module.kubernetes-cluster module.kube-cluster
However, because the random ids change, the state will break, requiring all resources under the construct to be recreated.
From the docs, constructs are suffixed with a hash. I’m not sure why this is necessary, since constructs require a unique id anyway.
Is there a way to avoid these random ids, or make them deterministic?