I have an issue with a local variable i’m attempting to create for use by subsequent locals.
I’ve made the var names simple for the sake of this post, but the logic still applies:
local_variable = var.var1["enabled"] == true ? concat([var.var1], var.var2, var.var3, [var.var4], [var.var5]) : concat(var.var2, var.var3, [var.var4], [var.var5])
…which gives me the following error:
The true and false result expressions must have consistent types. The ‘true’ tuple has length 5, but the ‘false’ tuple has length 4.
I genuinely need this logic as i’m then using the variable to loop through and create flattened maps for various modules.
Is there a recommended approach here? I’ve tried a number of alternative functions and true/false contents, however i’m sure i’ve missed something simple!
Thanks in advance.