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

What does `iterator` do in a dynamic block and when should you avoid dynamic blocks?

IntermediateConceptLoops, Conditionals, Dynamic Blocks and Functions
Answer

By default the iterator is named after the block label (ingress.value). iterator = rule renames it, which helps in nested dynamics. Avoid dynamic blocks for two or three static items: they hurt readability and make plans harder to follow. Use them for variable-length input.

All Terraform questions Roadmap: Terraform

More on Loops, Conditionals, Dynamic Blocks and Functions