From 8a912fa29aeec6727761f30dc1119514c5bd65c1 Mon Sep 17 00:00:00 2001 From: Piotr Sierkin Date: Thu, 28 Mar 2024 16:45:54 +0100 Subject: [PATCH] =?UTF-8?q?chore:=20refactor=C2=A0layout=20for=20condition?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Dominik Gniewek-Węgrzyn <47598580+dgniewek@users.noreply.github.com> --- variables.tf | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/variables.tf b/variables.tf index 730f1ef..d0f78ac 100644 --- a/variables.tf +++ b/variables.tf @@ -59,7 +59,13 @@ variable "schema_grants" { error_message = "Variable `schema_grants` fails validation - only one of `privileges` or `all_privileges` can be set." } validation { - condition = alltrue([for grant in var.schema_grants : + condition = alltrue([for grant in var.schema_grants : + sum([ + grant.all_schemas_in_database != null ? 1 : 0, + grant.future_schemas_in_database != null ? 1 : 0, + grant.schema_name != null ? 1 : 0 + ]) == 1 + ]) sum( [ grant.all_schemas_in_database != null ? 1 : 0,