File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change 1
1
locals {
2
- # This optional suffix is added to the end of resource names.
2
+ # This optional suffix is added to the end of resource names.
3
3
suffix = length (var. suffix ) == 0 ? " " : " -${ var . suffix } "
4
4
5
5
databricks_metastore_name = var. custom_databricks_metastore_name == null ? " meta-${ var . project } -${ var . env } -${ var . location } ${ local . suffix } " : var. custom_databricks_metastore_name
@@ -56,6 +56,14 @@ resource "databricks_metastore_data_access" "this" {
56
56
is_default = true
57
57
}
58
58
59
+ resource "databricks_metastore_assignment" "this" {
60
+ count = anytrue ([! var . create_metastore , length (var. external_metastore_id ) == 0 ]) ? 0 : 1
61
+
62
+ workspace_id = var. workspace_id
63
+ metastore_id = length (var. external_metastore_id ) == 0 ? databricks_metastore. this [0 ]. id : var. external_metastore_id
64
+ default_catalog_name = " hive_metastore"
65
+ }
66
+
59
67
# Catalog
60
68
resource "databricks_catalog" "this" {
61
69
for_each = alltrue ([! var . create_metastore , length (var. external_metastore_id ) == 0 ]) ? {} : var. catalog
Original file line number Diff line number Diff line change @@ -19,6 +19,11 @@ variable "suffix" {
19
19
default = " "
20
20
}
21
21
22
+ variable "workspace_id" {
23
+ type = string
24
+ description = " Id of Azure Databricks workspace"
25
+ }
26
+
22
27
# Unity Catalog variables
23
28
variable "create_metastore" {
24
29
type = bool
You can’t perform that action at this time.
0 commit comments