Skip to content

Variables

Declaring Input Variables

example.nomad
variable "memory" {
    type = number
    description = "The amount of memory to allocate to the task"
    default = 4000
}

job "example" {
    group "example" {
        task "example" {
            resources {
                memory = var.memory
            }

            config {
                args = [
                    "--memory, "${var.memory}"
                ]
            }
        }
    }
}
nomad job run -var="memory=1000" example.nomad

Resources


Last update: April 30, 2023
Created: April 30, 2023