How to reference variables?
Answer
Variable are referenced with var.VARIABLE_NAME syntax. Let's have a look at an example:
vars.tf:
variable "memory" {
type = string
default "8192"
}
variable "cpu" {
type = string
default = "4"
}
main.tf:
resource "libvirt_domain" "vm1" {
name = "vm1"
memory = var.memory
cpu = var.cpu
}