From 9d12f7bc879135f813f07eeaca1333bff39cd9c4 Mon Sep 17 00:00:00 2001 From: Piotr Sierkin Date: Thu, 21 Mar 2024 17:32:21 +0100 Subject: [PATCH] fix: parent_database_role and granted_database_roles passing arguments --- main.tf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.tf b/main.tf index ca6ea16..c80e1ef 100644 --- a/main.tf +++ b/main.tf @@ -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 }