Interview Prep/Terraform/Loops, Conditionals, Dynamic Blocks and Functions

What do `sort`, `reverse`, `slice`, `range`, `min` and `max` do?

IntermediateConceptLoops, Conditionals, Dynamic Blocks and Functions
Answer

sort orders strings, reverse reverses a list, slice(list, start, end) takes a sub-list, range(n) generates 0..n-1 (handy to build counts of names), min and max take numbers as separate arguments, so pass a list with the expansion symbol: max(var.sizes...). There is no built-in sum; use a for expression with a local or length-based arithmetic where you can.

All Terraform questions Roadmap: Terraform

More on Loops, Conditionals, Dynamic Blocks and Functions