Terraform Manifest Input VariablesBeta
Input variables for resource configuration are conventionally divided into special, external, and local.
Group | Description | Possible types |
|---|---|---|
Special | Variables that allow using data received from the broker. The following variables are supported:
When such variables are declared in the manifest, their values will be obtained by Terraform automatically |
|
External | Variables that allow setting values of pricing options configured in the pricing plan configuration wizard. The variable name must match the name of the pricing option YAML file. In addition to declaring such a variable in the manifest, it must also be:
A default value can be set for an external variable. It will be applied if the external value could not be obtained |
|
Local | Variables used only in the manifest. The variable value is set when it is declared in the | Any types supported by Terraform |
Example of declaring special variables:
# Service deployment identifiervariable "instance_uuid" {type = string}# User emailvariable "email" {type = string}
Example of declaring external and local variables:
# Name of the virtual network where the VM will be createdvariable "sub_network" {type = stringdefault = "test-net"}# Number of CPUs for the VMvariable "flavor_vcpus" {type = numberdefault = 2}
When describing input variables, you can use locals blocks. They allow computing variable values at the time of their declaration, including using the values of other declared variables. Example: specifying a host name using a local variable.