Last week, on my job, I encountered this error and couldn't find a solution available online, so I decided to write the solution I came up with, involving yamlencode and yamldecode to convert the ternary results to strings. This allowed the Terraform plan to pass.