Skip to content

Commit

Permalink
Fix short_term_retention_days as optional
Browse files Browse the repository at this point in the history
  • Loading branch information
LaurentLesle committed Sep 18, 2023
1 parent 9040a9c commit 3101f44
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
variable "short_term_retention_days" {
description = "short_term_retention_days .The backup retention period in days. This is how many days Point-in-Time Restore will be supported. Value must be atleast 1"
nullable = false
description = "short_term_retention_days (Optional) .The backup retention period in days. This is how many days Point-in-Time Restore will be supported. Value must be atleast 1"
nullable = true

validation {
condition = var.short_term_retention_days >= 1
condition = var.short_term_retention_day == null ? true : var.short_term_retention_days >= 1

error_message = format("Not supported value: '%s'. \nAdjust your configuration file with a supported value of 1 or more days", var.short_term_retention_days)
}
Expand Down

1 comment on commit 3101f44

@SimonSouli
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@LaurentLesle A bug is introduced with this modification.
Error: Invalid reference in variable validation on .terraform\modules\caf\modules\databases\mssql_managed_database_v1\var\settings[srtdays.tf](http://srtdays.tf/) line 6, in variable "short_term_retention_days":
condition = var.short_term_retention_day == null ? true : var.short_term_retention_days >= 1
The condition for variable "short_term_retention_days" can only refer to the variable itself, using var.short_term_retention_days.

I guess this is due to the typo line 6 where day is missing an S

Please sign in to comment.