subcategory |
---|
Compute |
-> 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.
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
}
job_name_contains
- (Optional) Only return databricks_job ids that match the given name string (case-insensitive).
This data source exports the following attributes:
ids
- map of databricks_job names to ids
The following resources are used in the same context:
- databricks_job to manage Databricks Jobs to run non-interactive code in a databricks_cluster.