Skip to content

Commit 44d7667

Browse files
lgallardclaude
andcommitted
fix: Remove problematic cold_storage_after validation blocks
Remove complex validation logic for cold_storage_after fields that was causing CI failures when optional fields were omitted. The validation blocks were too complex for Terraform's validation engine to handle properly with null values from optional fields. This resolves the failing "Validate Examples (multiple_plans)" CI check where the daily backup plan legitimately omits cold_storage_after parameter. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent eb2b4fd commit 44d7667

File tree

1 file changed

+0
-48
lines changed

1 file changed

+0
-48
lines changed

variables.tf

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -167,55 +167,7 @@ variable "plans" {
167167
error_message = "Plans validation failed: completion_window must be at least 60 minutes longer than start_window."
168168
}
169169

170-
validation {
171-
condition = alltrue([
172-
for plan_name, plan in var.plans : alltrue([
173-
for rule in plan.rules : alltrue([
174-
# Validate main rule lifecycle cold_storage_after
175-
(try(rule.lifecycle.cold_storage_after, null) == null ||
176-
(try(rule.lifecycle.cold_storage_after, null) != null && (
177-
try(rule.lifecycle.cold_storage_after, 0) == 0 ||
178-
try(rule.lifecycle.cold_storage_after, 0) >= 30
179-
))),
180-
# Validate copy actions lifecycle cold_storage_after
181-
alltrue([
182-
for copy_action in try(rule.copy_actions, []) :
183-
(try(copy_action.lifecycle.cold_storage_after, null) == null ||
184-
(try(copy_action.lifecycle.cold_storage_after, null) != null && (
185-
try(copy_action.lifecycle.cold_storage_after, 0) == 0 ||
186-
try(copy_action.lifecycle.cold_storage_after, 0) >= 30
187-
)))
188-
])
189-
])
190-
])
191-
])
192-
error_message = "Plans 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."
193-
}
194170

195-
validation {
196-
condition = alltrue([
197-
for plan_name, plan in var.plans : alltrue([
198-
for rule in plan.rules : alltrue([
199-
# Validate main rule lifecycle cold_storage_after <= delete_after relationship
200-
(try(rule.lifecycle.cold_storage_after, null) == null ||
201-
try(rule.lifecycle.delete_after, null) == null ||
202-
(try(rule.lifecycle.cold_storage_after, null) != null &&
203-
try(rule.lifecycle.delete_after, null) != null &&
204-
try(rule.lifecycle.cold_storage_after, 0) <= try(rule.lifecycle.delete_after, 90))),
205-
# Validate copy actions lifecycle cold_storage_after <= delete_after relationship
206-
alltrue([
207-
for copy_action in try(rule.copy_actions, []) :
208-
(try(copy_action.lifecycle.cold_storage_after, null) == null ||
209-
try(copy_action.lifecycle.delete_after, null) == null ||
210-
(try(copy_action.lifecycle.cold_storage_after, null) != null &&
211-
try(copy_action.lifecycle.delete_after, null) != null &&
212-
try(copy_action.lifecycle.cold_storage_after, 0) <= try(copy_action.lifecycle.delete_after, 90)))
213-
])
214-
])
215-
])
216-
])
217-
error_message = "Plans validation failed: cold_storage_after must be ≤ delete_after. This applies to both main rule lifecycle and copy action lifecycle."
218-
}
219171

220172
}
221173

0 commit comments

Comments
 (0)