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.
More on Loops, Conditionals, Dynamic Blocks and Functions
How does `count` work?BeginnerHow does `for_each` work?BeginnerWhen should you choose `for_each` over `count`?IntermediateHow do you use `for_each` with a list of objects?IntermediateWhat does "The for_each value depends on resource attributes that cannot be determined until apply" mean?AdvancedHow do you create a resource conditionally?Beginner