Skip to content

Commit

Permalink
chore: refactor layout for condition
Browse files Browse the repository at this point in the history
Co-authored-by: Dominik Gniewek-Węgrzyn <47598580+dgniewek@users.noreply.github.com>
  • Loading branch information
Santhin and dgniewek authored Mar 28, 2024
1 parent 7dbbe1e commit 8a912fa
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 8a912fa

Please sign in to comment.