Skip to content

Commit 6effd4e

Browse files
authored
fix: pitr validation inline with other ICD validation (#280)
1 parent de55740 commit 6effd4e

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

variables.tf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,16 @@ variable "pitr_id" {
407407
type = string
408408
description = "(Optional) The ID of the source deployment MySQL instance that you want to recover back to. The MySQL instance is expected to be in an up and in running state."
409409
default = null
410+
411+
validation {
412+
condition = var.pitr_id != null ? true : var.pitr_time == null
413+
error_message = "To use Point-In-Time Recovery (PITR), a value for var.pitr_id needs to be set when var.pitr_time is specified. Otherwise, unset var.pitr_time."
414+
}
415+
416+
validation {
417+
condition = var.pitr_id == null ? true : var.pitr_time != null
418+
error_message = "To use Point-In-Time Recovery (PITR), a value for var.pitr_time needs to be set when var.pitr_id is specified. Otherwise, unset var.pitr_id."
419+
}
410420
}
411421

412422
variable "pitr_time" {

0 commit comments

Comments
 (0)