Skip to content

Asset bundle run_job_task fails #812

@meretri

Description

@meretri

I get an error when trying to deploy a workflow job wich contains a "Run Job" Task:

databricks.yml

 # yaml-language-server: $schema=bundle-settings-schema.json 
bundle:
  name: run_job_example
targets:
  development:
    workspace:
      host: https://xxx.azuredatabricks.net
      profile: xyz
resources:
  jobs:
    job1:
      name: job1
      tasks:       
      - task_key: STEP_1
        run_job_task:
          job_id: 12345

The validation step is successful, but when trying to deploy, I get the following error:

Starting resource deployment
Error: terraform apply: exit status 1

Error: cannot create job: Job 0 does not exist.

  with databricks_job.job1,
  on bundle.tf.json line 25, in resource.databricks_job.job1:
  25:       }

The job ID is missing in the bundle.tf.json:

{
  "terraform": {
    "required_providers": {
      "databricks": {
        "source": "databricks/databricks",
        "version": "1.23.0"
      }
    }
  },
  "provider": {
    "databricks": {}
  },
  "resource": {
    "databricks_job": {
      "job1": {
        "name": "job1",
        "task": [
          {
            "task_key": "STEP_1",
            "run_job_task": {
              "job_id": ""
            }
          }
        ]
      }
    }
  }
}

I assume the reason for this is, that terraform expects a string as job ID and not a int. But quoting the ID results in a different error:

Error: failed to load databricks.yml: error unmarshaling JSON: json: cannot unmarshal string into Go struct field RunJobTask.resources.jobs.tasks.run_job_task.job_id of type int

Metadata

Metadata

Assignees

Labels

BugSomething isn't workingDABsDABs related issues

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions