-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathworkspaces.tf
More file actions
34 lines (29 loc) · 822 Bytes
/
workspaces.tf
File metadata and controls
34 lines (29 loc) · 822 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
locals {
workspaces_json = [
for x in jsondecode(file("${path.module}/.metadata.tmp/workspaces.json")) :
merge(x, {
"workspace_name" = reverse(split("/", x["workspace_resource_id"]))[0]
})
]
workspaces_by_name = {
for x in local.workspaces_json :
x.workspace_name => x
if x.enabled
}
workspaces_by_id = {
for x in local.workspaces_json :
x.workspace_id => x
if x.enabled
}
}
module "dbr_workspace" {
for_each = local.workspaces_by_name
source = "./modules/workspace"
providers = {
databricks.admin = databricks.admin
databricks.account = databricks.account
}
databricks_workspace_id = each.value.workspace_id
databricks_metastore_id = databricks_metastore.this.id
depends_on = [databricks_metastore.this]
}