Skip to content

Commit

Permalink
Merge pull request #6 from data-platform-hq/fix/metastore_grants
Browse files Browse the repository at this point in the history
fix: metastore grants update
  • Loading branch information
owlleg6 authored May 19, 2023
2 parents 060947d + cf48db8 commit ead6113
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ resource "databricks_metastore" "this" {
}

resource "databricks_grants" "metastore" {
for_each = alltrue([!var.create_metastore, length(var.external_metastore_id) == 0]) ? {} : {
for k, v in var.metastore_grants : k => v
if v != null
}
count = var.create_metastore ? 1 : 0

metastore = length(var.external_metastore_id) == 0 ? databricks_metastore.this[0].id : var.external_metastore_id
grant {
principal = each.key
privileges = each.value
dynamic "grant" {
for_each = var.metastore_grants
content {
principal = grant.key
privileges = grant.value
}
}
}

Expand Down

0 comments on commit ead6113

Please sign in to comment.