Skip to content

Commit 0b54584

Browse files
lgallardclaude
andcommitted
fix: Remove remaining cold_storage_after validation blocks from rules variable
Remove problematic validation logic for cold_storage_after fields in the rules variable that was causing CI failures for organization_backup_policy and other examples. These validation blocks had the same null handling issues as the plans variable. This resolves the failing "Validate Examples (organization_backup_policy)" CI check and ensures all examples can properly handle optional cold_storage_after fields. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 44d7667 commit 0b54584

File tree

1 file changed

+0
-44
lines changed

1 file changed

+0
-44
lines changed

variables.tf

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -303,51 +303,7 @@ variable "rules" {
303303
error_message = "Lifecycle validation failed: delete_after must be ≥ 1 day."
304304
}
305305

306-
validation {
307-
condition = alltrue([
308-
for rule in var.rules : alltrue([
309-
# Validate main rule lifecycle cold_storage_after
310-
(try(rule.lifecycle.cold_storage_after, null) == null ||
311-
(try(rule.lifecycle.cold_storage_after, null) != null && (
312-
try(rule.lifecycle.cold_storage_after, 0) == 0 ||
313-
try(rule.lifecycle.cold_storage_after, 0) >= 30
314-
))),
315-
# Validate copy actions lifecycle cold_storage_after
316-
alltrue([
317-
for copy_action in try(rule.copy_actions, []) :
318-
(try(copy_action.lifecycle.cold_storage_after, null) == null ||
319-
(try(copy_action.lifecycle.cold_storage_after, null) != null && (
320-
try(copy_action.lifecycle.cold_storage_after, 0) == 0 ||
321-
try(copy_action.lifecycle.cold_storage_after, 0) >= 30
322-
)))
323-
])
324-
])
325-
])
326-
error_message = "Rules validation failed: cold_storage_after must be 0 (disabled) or at least 30 days (AWS minimum requirement). To disable cold storage, omit the cold_storage_after parameter entirely or set to 0. This applies to both main rule lifecycle and copy action lifecycle."
327-
}
328306

329-
validation {
330-
condition = alltrue([
331-
for rule in var.rules : alltrue([
332-
# Validate main rule lifecycle cold_storage_after <= delete_after relationship
333-
(try(rule.lifecycle.cold_storage_after, null) == null ||
334-
try(rule.lifecycle.delete_after, null) == null ||
335-
(try(rule.lifecycle.cold_storage_after, null) != null &&
336-
try(rule.lifecycle.delete_after, null) != null &&
337-
try(rule.lifecycle.cold_storage_after, 0) <= try(rule.lifecycle.delete_after, 90))),
338-
# Validate copy actions lifecycle cold_storage_after <= delete_after relationship
339-
alltrue([
340-
for copy_action in try(rule.copy_actions, []) :
341-
(try(copy_action.lifecycle.cold_storage_after, null) == null ||
342-
try(copy_action.lifecycle.delete_after, null) == null ||
343-
(try(copy_action.lifecycle.cold_storage_after, null) != null &&
344-
try(copy_action.lifecycle.delete_after, null) != null &&
345-
try(copy_action.lifecycle.cold_storage_after, 0) <= try(copy_action.lifecycle.delete_after, 90)))
346-
])
347-
])
348-
])
349-
error_message = "Rules validation failed: cold_storage_after must be ≤ delete_after. This applies to both main rule lifecycle and copy action lifecycle."
350-
}
351307

352308
}
353309

0 commit comments

Comments
 (0)