Good morning. Is there something special about setting variables with boolean values in a terraform.tfvars file? I have string variables set there the exact same way and they're working in
main.tf, but for some reason the boolean variables aren't working. However, when I set them in
main.tf they work as expected. I would much rather have these set in the terraform.tfvars file, so any help would be greatly appreciated. I've tried searching for the answer everywhere and came up empty. Thank you.
Boolean Vars Not Working:
=====================
terraform.tfvars:
var1 = false
var2 = true
var3 = "string"
module "mod1" {
source = "./modules/mod1"
var1 = "${var.var1}" # Throws an "unknown variable referenced: 'var1'; define it with a 'variable' block
var2 = "${var.var2}" # Throws an "unknown variable referenced: 'var2'; define it with a 'variable' block
var3 = "${var.var3}" # works as expected
Boolean Vars Working:
==================
terraform.tfvars:
var3 = "string"
variable "var1" {default = false}
variable "var2" {default = true}
module "mod1" {
source = "./modules/mod1"
var1 = "${var.var1}" # works as expected
var2 = "${var.var2}" # works as expected
var3 = "${var.var3}" # works as expected