Skip to content

Latest commit

 

History

History
59 lines (39 loc) · 2.02 KB

File metadata and controls

59 lines (39 loc) · 2.02 KB
subcategory
Compute

databricks_jobs Data Source

-> Note If you have a fully automated setup with workspaces created by databricks_mws_workspaces or azurerm_databricks_workspace, please make sure to add depends_on attribute in order to prevent default auth: cannot configure default credentials errors.

Retrieves a list of databricks_job ids, that were created by Terraform or manually, so that special handling could be applied.

-> Note Data resource will error in case of jobs with duplicate names.

Example Usage

Granting view databricks_permissions to all databricks_job within the workspace:

data "databricks_jobs" "this" {}

data "databricks_jobs" "tests" {
  job_name_contains = "test"
}

resource "databricks_permissions" "everyone_can_view_all_jobs" {
  for_each = data.databricks_jobs.this.ids
  job_id   = each.value

  access_control {
    group_name       = "users"
    permission_level = "CAN_VIEW"
  }
}

Getting ID of specific databricks_job by name:

data "databricks_jobs" "this" {}

output "x" {
  value     = "ID of `x` job is ${data.databricks_jobs.this.ids["x"]}"
  sensitive = false
}

Argument Reference

  • job_name_contains - (Optional) Only return databricks_job ids that match the given name string (case-insensitive).

Attribute Reference

This data source exports the following attributes:

Related Resources

The following resources are used in the same context: