databricks-sync
databricks-sync copied to clipboard
Import fails due to missing variables
Hi all. This tool fails to import due to missing Terraform variables. An example of which is below, but it is not always just this type of variable:
Error: Reference to undeclared input variable
on databricks_cluster_0729_150142_zrxr8z13.tf.json line 41, in resource.databricks_cluster.databricks_cluster_0729_150142_zrxr8z13:
41: "node_type_id": "${var.m5_large}",
An input variable with the name "m5_large" has not been declared. This variable can be declared with a variable "m5_large" {} block.
This is a clean E2 workspace with nothing in it. I am attempting to import an export generated from a legacy workspace in another account.
On another note, is there an option to generate .tf files based on the export files? Or see the temporary files used to generate the plan?
+1
I am seeing the same thing currently. It had worked before with a different workspace to export and import but now it is failing when trying to import. Also I see it had not generated the tf to init these variables.
I just reran an export in my initial environment and a file "terraform.tfvars" got created with the variables needed. So in this env it seems to all be working but not in the other env. I will checkout the differences now.
I see the following entries in the export log where the export / import is working but I am not seeing this part where the export / import is failing:
2022-11-04 17:33:11 [INFO] Processing changes found in directory/file: exports. 2022-11-04 17:33:11 [INFO] Processing changes found in directory/file: terraform.tfvars. 2022-11-04 17:33:11 [INFO] Processing changes found in directory/file: variables_env.sh. 2022-11-04 17:33:11 [INFO] Processing changes found in directory/file: databricks_spark_env.sh. 2022-11-04 17:33:11 [INFO] ===FINISHED LOCAL COMMIT=== 2022-11-04 17:33:11 [INFO] ===FINISHED LOCAL TAGGING: v20221104173311837153=== 2022-11-04 17:33:11 [INFO] Main TF File: {
What I see instead however in the environment where it is failing to generate the variables I am seeing some 403 errors on exporting secrets.
Aha, I now commented out the configuration for exporting secrets and I can see in the generated TF code for the export that it had properly created a variables TF file. So this seems to have been the issue for me here. Currently busy doing a fresh export and import.