You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Retrieves a list of databricks_job ids, that were created by Terraform or manually, so that special handling could be applied.
## Example Usage
Granting view [databricks_permissions](../resources/permissions.md) to all [databricks_job](../resources/job.md) within the workspace:
```hcl
data "databricks_jobs" "this" {}
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](../resources/job.md) by name:
```hcl
data "databricks_jobs" "this" {}
output "x" {
value = "ID of `x` job is ${data.databricks_jobs.this.ids["x"]}"
sensitive = false
}
```
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,7 @@
3
3
## 0.5.1
4
4
5
5
* Added an extended documentation from provisioning AWS PrivateLink workspace ([#1084](https://github.com/databrickslabs/terraform-provider-databricks/pull/1084)).
6
+
* Added `databricks_jobs` data resource to get a map of all job names and their ids ([#1138](https://github.com/databrickslabs/terraform-provider-databricks/pull/1138)).
-> **Note** If you have a fully automated setup with workspaces created by [databricks_mws_workspaces](../resources/mws_workspaces.md) or [azurerm_databricks_workspace](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/databricks_workspace), please make sure to add [depends_on attribute](../index.md#data-resources-and-authentication-is-not-configured-errors) in order to prevent _authentication is not configured for provider_ errors.
7
+
8
+
Retrieves a list of [databricks_job](../resources/job.md) ids, that were created by Terraform or manually, so that special handling could be applied.
9
+
10
+
-> **Note** Data resource will error in case of jobs with duplicate names.
11
+
12
+
## Example Usage
13
+
14
+
Granting view [databricks_permissions](../resources/permissions.md) to all [databricks_job](../resources/job.md) within the workspace:
Getting ID of specific [databricks_job](../resources/job.md) by name:
31
+
32
+
```hcl
33
+
data "databricks_jobs" "this" {}
34
+
35
+
output "x" {
36
+
value = "ID of `x` job is ${data.databricks_jobs.this.ids["x"]}"
37
+
sensitive = false
38
+
}
39
+
```
40
+
41
+
## Attribute Reference
42
+
43
+
This data source exports the following attributes:
44
+
45
+
*`ids` - map of [databricks_job](../resources/job.md) names to ids
46
+
47
+
## Related Resources
48
+
49
+
The following resources are used in the same context:
50
+
51
+
*[databricks_job](../resources/job.md) to manage [Databricks Jobs](https://docs.databricks.com/jobs.html) to run non-interactive code in a [databricks_cluster](../resources/cluster.md).
Copy file name to clipboardExpand all lines: docs/resources/job.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -221,6 +221,7 @@ The following resources are often used in the same context:
221
221
*[databricks_global_init_script](global_init_script.md) to manage [global init scripts](https://docs.databricks.com/clusters/init-scripts.html#global-init-scripts), which are run on all [databricks_cluster](cluster.md#init_scripts) and [databricks_job](job.md#new_cluster).
222
222
*[databricks_instance_pool](instance_pool.md) to manage [instance pools](https://docs.databricks.com/clusters/instance-pools/index.html) to reduce [cluster](cluster.md) start and auto-scaling times by maintaining a set of idle, ready-to-use instances.
223
223
*[databricks_instance_profile](instance_profile.md) to manage AWS EC2 instance profiles that users can launch [databricks_cluster](cluster.md) and access data, like [databricks_mount](mount.md).
224
+
*[databricks_jobs] data to get all jobs and their names from a workspace.
224
225
*[databricks_library](library.md) to install a [library](https://docs.databricks.com/libraries/index.html) on [databricks_cluster](cluster.md).
225
226
*[databricks_node_type](../data-sources/node_type.md) data to get the smallest node type for [databricks_cluster](cluster.md) that fits search criteria, like amount of RAM or number of cores.
226
227
*[databricks_notebook](notebook.md) to manage [Databricks Notebooks](https://docs.databricks.com/notebooks/index.html).
0 commit comments