cancel
Showing results for 
Search instead for 
Did you mean: 
Community Platform Discussions
Connect with fellow community members to discuss general topics related to the Databricks platform, industry trends, and best practices. Share experiences, ask questions, and foster collaboration within the community.
cancel
Showing results for 
Search instead for 
Did you mean: 

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!

 

 

2 REPLIES 2

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
Esteemed Contributor

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

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

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group