Search⌘ K
AI Features

Input Variables (Variables)

Explore how to define and manage input variables in Terraform configurations for Azure. Understand different ways to assign variable values, including blocks, shorthand syntax, runtime arguments, and variable definition files, to create flexible and maintainable infrastructure code.

Variables in Terraform are like in any other programming or scripting language; they hold values. Variables can hold many different types of information to call on later in a configuration file.

Variable definition syntax

Variables are handy HCL constructs that can be defined in a few different ways and in a few different places.

Blocks

Variables can be defined in a block with various arguments in the form:

variable "<variable name>" {
    type = <type> ## string, number or bool
    <default = <value>>
    <description = "">
}

You can find more information about each type of ...