Interview Prep/Terraform/Variables, Locals, Outputs and Types

Why is `type = any` discouraged?

IntermediateConceptVariables, Locals, Outputs and Types
Answer

It disables validation and defers type errors until the value is used, often with confusing messages deep inside a resource. Terraform also infers one concrete type from the value passed, which can change behaviour between callers. Use precise object and map types in module interfaces.

All Terraform questions Roadmap: Terraform

More on Variables, Locals, Outputs and Types