Loading...
Loading...
Master variable types, validation, sensitive values
Beyond basic types, Terraform supports complex types:
variable "tags" {
description = "Resource tags"
type = map(string)
default = { Environment = "dev", ManagedBy = "terraform" }
}
variable "vm_config" {
type = object({
size = string
disk_size = number
image = string
})
}
variable "db_password" {
type = string
sensitive = true
}Use validation blocks for constraints and sensitive = true for secrets.
variable "db_password" {
description = "Database password"
type = string
sensitive = true
}