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

How do `coalesce`, `coalescelist` and `try` differ?

IntermediateConceptLoops, Conditionals, Dynamic Blocks and Functions
Answer

coalesce(a, b, c) returns the first non-null, non-empty-string argument. coalescelist returns the first non-empty list. try returns the first expression that does not raise an error, so it can handle missing attributes. coalesce does not rescue errors, and try does not skip nulls.

All Terraform questions Roadmap: Terraform

More on Loops, Conditionals, Dynamic Blocks and Functions