I have two booleans, use bastion and use_vault. How can I use both as a condtition in a module, i.e. when both true do?
variable "use_bastion" {
type = bool
default = true
}
variable "use_vault" {
type = bool
default = true
}
I’m using count and a single check is fine, i.e.
count = var.use_vault ? 1 : 0
I tried combining as follows
count = "${var.use_vault * var.use_bastion}"
but it fails with
“var.use_vault is a bool, known only after apply. Unsuitable value for left operand: number required.”
Nested doesn’t fail but doesn’t give me what I need, i.e.
count = ( var.use_vault ? 1 : ( var.use_bastion ? 1 : 0 ))