I have a template in my terraform config to which I write the values of a variable like this:
data "template_file" "config" {
template = "${file("${path.module}/templates/${var.json_config}")}"
vars {
is_enabled = "${var.is_enabled}"
}
}
Now is_enabled is a boolean string which is either set to true or false. Now based on if this is true or false I want to set another variable. In pseudocode it would look like this:
if is_enabled == true path = /one/path/ else path = /another/path
I had a look at the conditional values but it seems to be for bringing up resources. how would I use this to set a variable in a template file ?