diff --git a/variables.tf b/variables.tf index d0f78ac..181c5d3 100644 --- a/variables.tf +++ b/variables.tf @@ -59,20 +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, - grant.future_schemas_in_database != null ? 1 : 0, - grant.schema_name != null ? 1 : 0]) == 1 - ] - ) error_message = "Variable `schema_grants` fails validation - only one of `all_schemas_in_database`, `future_schemas_in_database`, or `schema_name` can be set." } }