no-nested-conditional
Prefer a named value or explicit input over chained Terraform conditional selections.
Why
Chained conditional branches obscure the value being selected and scatter deployment policy.
Fix
Extract a branch into a named local or pass a typed input from the caller. Preserve lazy evaluation, null guards and resource dependencies when extracting an expression.
Examples
locals { size = var.primary ? "large" : var.secondary ? "medium" : "small"}variable "size" { type = string }module "service" { source = "./service" size = var.size}