Terraform provider, problemi in creating dependant task!

6502
New Contributor III

Hola all.

I have a serious problem, perhaps I missed something, but can't find the solution. 
I need to push a job description to Databricks using TERRAFORM. I wrote the code, but there is no way to get a task dependant from two different tasks.

Consider the following code: 

task { 
task_key = "ichi"
job_cluster = "C64"
notebook_task {
notebook_path = "REPO_NOTEBOOK"
source = "GIT
}
}

task {
task_key = "ni"
job_cluster = "C64"
notebook_task {
notebook_path = "REPO_NOTEBOOK"
source = "GIT
}
}
task {
task_key = "san"
depends_on {
task_key = "ichi" ... but how make this dependant also from the "ni" task?
}
job_cluster = "C64"
notebook_task {
notebook_path = "REPO_NOTEBOOK"
source = "GIT
}
}

I attempted to use:

task_key = "ichi,ni" -> does not work.
task_key = [ "ichi", "ni" ] -> still does not work

HELP!

The Website databricks_job | Resources | databricks/databricks | Terraform | Terraform Registry  does not help. It seems that there is no way to make it dependent on more than one task!

 

 

6502
New Contributor III

Hola. 
I'm answering because a solution has been found. 

   depends_on {
           task_key =   "ichi"
   }   

   depends_on {
            task_key =   "ni"
   } 

Adding two "depends_on" solved the problem. I came up with this solution using the experimental exporter : 

https://registry.terraform.io/providers/databricks/databricks/latest/docs/guides/experimental-export... 

 

daniel_sahal
Databricks MVP

@6502 You need to make multiple depends_on blocks for each dependency, ex.

depends_on {
   task_key = "ichi"
}
depends_on {
   task_key = "ni"
}