Skip to content

Commit

Permalink
chore: revert changes
Browse files Browse the repository at this point in the history
  • Loading branch information
PiotrSierkin-Ki committed Jul 11, 2023
1 parent d89fb8d commit 8870cd6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,11 @@ locals {
}]...)

view_grants = merge([for view_grant in var.view_grants : {
for privilege in view_grant.privileges : "${view_grant.database_name}/${view_grant.schema_name}/${view_grant.view_name}/${privilege}" => {
for privilege in view_grant.privileges : "${view_grant.database_name}/${view_grant.schema_name}/${coalesce(view_grant.view_name, "on_future")}/${privilege}" => {
database_name = view_grant.database_name
schema_name = view_grant.schema_name
view_name = view_grant.view_name
on_future = view_grant.on_future
privilege = privilege
}
}]...)
Expand Down
1 change: 1 addition & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ resource "snowflake_view_grant" "this" {
schema_name = each.value.schema_name
view_name = each.value.view_name
privilege = each.value.privilege
on_future = each.value.on_future
roles = [one(snowflake_role.this[*].name)]
}

Expand Down
1 change: 1 addition & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ variable "view_grants" {
database_name = string
schema_name = string
view_name = optional(string)
on_future = optional(bool, false)
privileges = list(string)
}))
default = []
Expand Down

0 comments on commit 8870cd6

Please sign in to comment.