Multi line terneray expression in terraform
If you’re using Terraform writing multi line ternary expressions can come in handy. They can also be nested which can be useful – but be careful that it doesn’t become unreadable!
As seen in the above code snippet wrapping the entire expression in parenthesees allows the nested ternary, otherwise terraform would throw an error. We’ll talk about what terraform is and why and how to use it in a later post!