Skip to content

Commit

Permalink
fix: parent_database_role and granted_database_roles passing arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
PiotrSierkin-Ki committed Mar 21, 2024
1 parent ebb9941 commit 9d12f7b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ resource "snowflake_grant_database_role" "parent_database_role" {
count = module.this.enabled && var.parent_database_role != null ? 1 : 0

database_role_name = local.database_role_name
parent_database_role_name = var.parent_database_role
parent_database_role_name = "${one(snowflake_database_role.this[*].database)}.${var.parent_database_role}"
}

resource "snowflake_grant_database_role" "granted_database_roles" {
for_each = toset(module.this.enabled ? var.granted_database_roles : [])

database_role_name = each.value
database_role_name = each.value != null ? "${one(snowflake_database_role.this[*].database)}.${each.value}" : null
parent_database_role_name = local.database_role_name
}

Expand Down

0 comments on commit 9d12f7b

Please sign in to comment.