diff --git a/locals.tf b/locals.tf index 871d06a..b1b1091 100644 --- a/locals.tf +++ b/locals.tf @@ -9,7 +9,7 @@ locals { database_grants = { for database_grant in var.database_grants : - "${one(snowflake_database_role.this[*].database)}_${one(snowflake_database_role.this[*].name)}_${database_grant.all_privileges == true ? "ALL" : "CUSTOM"}" => database_grant + "${one(snowflake_database_role.this[*].name)}_${database_grant.all_privileges == true ? "ALL" : "CUSTOM"}" => database_grant } schema_grants = { @@ -31,7 +31,7 @@ locals { ) ] : [grant] ]) : - "${one(snowflake_database_role.this[*].database)}_${one(snowflake_database_role.this[*].name)}_${ + "${one(snowflake_database_role.this[*].name)}_${ schema_grant.schema_name != null ? schema_grant.schema_name : schema_grant.all_schemas_in_database != false ? "ALL_SCHEMAS" : schema_grant.future_schemas_in_database != false ? "FUTURE_SCHEMAS" : "" @@ -67,7 +67,7 @@ locals { ) ] ] - ]) : "${one(snowflake_database_role.this[*].database)}_${one(snowflake_database_role.this[*].name)}${ + ]) : "${one(snowflake_database_role.this[*].name)}${ grant.object_type != null && grant.object_name != null ? "_${grant.object_type}_${grant.object_name}_${grant.all_privileges == true ? "ALL" : "CUSTOM"}" : ""