Skip to content

Commit

Permalink
fix: removed wal_level setting from DA default configuration to wor…
Browse files Browse the repository at this point in the history
…karound a backend schema bug. By not setting it, it will default to `replica`. (#514)
  • Loading branch information
shemau authored Nov 7, 2024
1 parent 21c0b23 commit 97a9f96
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
1 change: 0 additions & 1 deletion examples/complete/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ module "postgresql_db" {
tcp_keepalives_interval = 50
tcp_keepalives_count = 6
archive_timeout = 1000
wal_level = "replica"
max_replication_slots = 10
max_wal_senders = 20
}
Expand Down
1 change: 0 additions & 1 deletion solutions/standard/DA-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ The following example shows values for the `configuration` input.
"tcp_keepalives_interval": 15,
"tcp_keepalives_count": 6,
"archive_timeout": 1800,
"wal_level": "replica",
"max_replication_slots": 10,
"max_wal_senders": 12
}
Expand Down
1 change: 0 additions & 1 deletion solutions/standard/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ variable "configuration" {
tcp_keepalives_interval = 15
tcp_keepalives_count = 6
archive_timeout = 1800
wal_level = "replica"
max_replication_slots = 10
max_wal_senders = 12
}
Expand Down
9 changes: 5 additions & 4 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,11 @@ variable "configuration" {
error_message = "Value for `configuration[\"archive_timeout\"]` must be 300 or more, if specified."
}

validation {
condition = var.configuration != null ? (var.configuration["wal_level"] != null ? contains(["replica", "logical"], var.configuration["wal_level"]) : true) : true
error_message = "Value for `configuration[\"wal_level\"]` must be either `replica` or `logical`, if specified."
}
# skip validation for issue #508 and #512
#validation {
# condition = var.configuration != null ? (var.configuration["wal_level"] != null ? contains(["replica", "logical"], var.configuration["wal_level"]) : true) : true
# error_message = "Value for `configuration[\"wal_level\"]` must be either `replica` or `logical`, if specified."
#}

validation {
condition = var.configuration != null ? (var.configuration["max_replication_slots"] != null ? var.configuration["max_replication_slots"] >= 10 : true) : true
Expand Down

0 comments on commit 97a9f96

Please sign in to comment.