Skip to content

Commit ba43689

Browse files
authored
Merge pull request #9 from data-platform-hq/fix_metastore_grants_condition
fix: updated condition for metastore grants
2 parents d7bb0d5 + 3bdfa5b commit ba43689

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

main.tf

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
locals {
22
# This optional suffix is added to the end of resource names.
3-
suffix = length(var.suffix) == 0 ? "" : "-${var.suffix}"
4-
5-
databricks_metastore_name = var.custom_databricks_metastore_name == null ? "meta-${var.project}-${var.env}-${var.location}${local.suffix}" : var.custom_databricks_metastore_name
6-
3+
suffix = length(var.suffix) == 0 ? "" : "-${var.suffix}"
4+
databricks_metastore_name = var.custom_databricks_metastore_name == null ? "meta-${var.project}-${var.env}-${var.location}${local.suffix}" : var.custom_databricks_metastore_name
75
databricks_metastore_container_name = var.custom_databricks_metastore_container_name == null ? "meta-${var.project}-${var.env}" : var.custom_databricks_metastore_container_name
86
}
97

@@ -21,7 +19,6 @@ resource "azurerm_storage_data_lake_gen2_filesystem" "this" {
2119
error_message = "To create Metastore in a Region it is required to provide proper values for these variables: access_connector_id, storage_account_id, storage_account_name"
2220
}
2321
}
24-
2522
}
2623

2724
resource "databricks_metastore" "this" {
@@ -33,7 +30,7 @@ resource "databricks_metastore" "this" {
3330
}
3431

3532
resource "databricks_grants" "metastore" {
36-
count = var.create_metastore ? 1 : 0
33+
count = length(var.metastore_grants) != 0 ? 1 : 0
3734

3835
metastore = length(var.external_metastore_id) == 0 ? databricks_metastore.this[0].id : var.external_metastore_id
3936
dynamic "grant" {

0 commit comments

Comments
 (0)