Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import fails due to missing variables #116

Open
tristansirrico opened this issue Aug 15, 2022 · 4 comments
Open

Import fails due to missing variables #116

tristansirrico opened this issue Aug 15, 2022 · 4 comments

Comments

@tristansirrico
Copy link

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?

@philippbussche
Copy link

+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.

@philippbussche
Copy link

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.

@philippbussche
Copy link

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.

@philippbussche
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants