Terraform
Terraform Variable
Appears inTerraform Associate
An input parameter that lets you parameterize Terraform configurations. Declared with variable {} and assigned via a .tfvars file, environment variables (TF_VAR_), -var flags, or interactively.
On the exam
In Terraform Associate there are three types: Input variables (input parameters), Local values (reusable expressions), and Output values (exported values). Question: how do you avoid hardcoding a VM size in multiple places? Input variable + local.
Related terms
- Terraform OutputA value exported after a terraform apply. Lets you expose resource attributes (IPs, URLs, IDs) for use in other modules or to display to the user. Declared with output {} in outputs.tf.
- Terraform ModuleA reusable set of Terraform resources grouped in a directory. The root module is the main working directory. Child modules are called from the root and can come from local sources, the Terraform Registry, or Git repositories.