Skip to content

Commit

Permalink
feat: bump snowflake-schema + support for add_grants_to_existing_objects
Browse files Browse the repository at this point in the history
  • Loading branch information
dgniewek committed Jan 11, 2024
1 parent c0572e9 commit 6b00f74
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 23 deletions.
7 changes: 4 additions & 3 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ module "snowflake_schema" {
for_each = local.schemas

source = "getindata/schema/snowflake"
version = "1.4.0"
version = "1.5.0"

context = module.this.context
enabled = local.enabled && each.value.enabled
Expand All @@ -80,8 +80,9 @@ module "snowflake_schema" {

stages = each.value.stages

create_default_roles = coalesce(each.value.create_default_roles, var.create_default_roles)
roles = each.value.roles
create_default_roles = coalesce(each.value.create_default_roles, var.create_default_roles)
add_grants_to_existing_objects = coalesce(each.value.add_grants_to_existing_objects, false)
roles = each.value.roles
}

resource "snowflake_database_grant" "this" {
Expand Down
42 changes: 22 additions & 20 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -100,27 +100,29 @@ variable "schemas" {
stage_grants = optional(list(string))
})), {})
})), {})
create_default_roles = optional(bool)
create_default_roles = optional(bool)
add_grants_to_existing_objects = optional(bool)
roles = optional(map(object({
enabled = optional(bool, true)
descriptor_name = optional(string, "snowflake-role")
comment = optional(string)
role_ownership_grant = optional(string)
granted_roles = optional(list(string))
granted_to_roles = optional(list(string))
granted_to_users = optional(list(string))
schema_grants = optional(list(string))
table_grants = optional(list(string))
external_table_grants = optional(list(string))
view_grants = optional(list(string))
materialized_view_grants = optional(list(string))
file_format_grants = optional(list(string))
function_grants = optional(list(string))
stage_grants = optional(list(string))
task_grants = optional(list(string))
procedure_grants = optional(list(string))
sequence_grants = optional(list(string))
stream_grants = optional(list(string))
enabled = optional(bool, true)
descriptor_name = optional(string, "snowflake-role")
comment = optional(string)
role_ownership_grant = optional(string)
granted_roles = optional(list(string))
granted_to_roles = optional(list(string))
granted_to_users = optional(list(string))
add_grants_to_existing_objects = optional(bool)
schema_grants = optional(list(string))
table_grants = optional(list(string))
external_table_grants = optional(list(string))
view_grants = optional(list(string))
materialized_view_grants = optional(list(string))
file_format_grants = optional(list(string))
function_grants = optional(list(string))
stage_grants = optional(list(string))
task_grants = optional(list(string))
procedure_grants = optional(list(string))
sequence_grants = optional(list(string))
stream_grants = optional(list(string))
})), {})
}))
default = {}
Expand Down

0 comments on commit 6b00f74

Please sign in to comment.