Terraform: Language & Workflow: glossary
160 terms, in plain words, with where each one is taught.
- -auto-approve
- Apply without asking for
yes. Fine in a lab or after a human approved the plan; reckless on prod from a laptop. - -detailed-exitcode
- Makes plan exit 0 for no changes, 2 for changes pending, 1 for an error - scriptable drift detection. Lesson 14.24
- -input=false (TF_INPUT)
- Never prompt for missing values; a missing required variable becomes an error. Used in automation. Lesson 14.5
- -refresh-only
- A plan or apply that only reports (or records) what changed outside Terraform, proposing no changes of its own. Lesson 14.24
- -replace
-replace=ADDRforces one resource to be destroyed and re-created, visibly in the plan. Replacedterraform taint. Lesson 14.24- -target
-target=ADDRlimits plan/apply to one resource and what it needs. An emergency tool, with warnings. Lesson 14.24- -var (-var-file)
- Command-line flags that set variables for one run:
-var env=prodor-var-file=prod.tfvars. They beat every other source. Lesson 14.5 - .tf file (.tf)
- A file of Terraform code. Conventional names: main.tf, variables.tf, outputs.tf, providers.tf. Lesson 14.1
- address (resource address)
- How you name one thing in a configuration:
azurerm_subnet.app,azurerm_subnet.app["web"],data.azurerm_client_config.current. Lesson 14.1 - Ansible
- A configuration-management tool that runs tasks over SSH to set up machines. It keeps no state file. Lesson 14.1
- attribute
- A value a resource has, which you can read: ones you set (
name) and ones the provider fills in after creating it (id). Lesson 14.1 - availability zone
- One of several separate data centres inside a region; spreading copies over zones survives one site failing. Lesson 14.14
- AWS
- Amazon's cloud, Azure's biggest competitor. Mentioned only for comparison. Lesson 14.1
- Azure
- Microsoft's cloud. The Terraform labs create Azure things (simulated on the box); Azure itself is taught much later. Lesson 14.1
- Azure blob
- Azure's word for a file kept in a storage account. Lesson 14.1
- azurerm (hashicorp/azurerm)
- The provider for Azure. Resource types starting with
azurerm_belong to it. Lesson 14.1 - azurerm_client_config
- A data source with no arguments that returns who is running Terraform: tenant, subscription, client and object IDs. Lesson 14.18
- Bicep (ARM template)
- Azure's own declarative infrastructure language (ARM templates are its older JSON form). Azure-only. Lesson 14.1
- block
- The unit of HCL: a type (
resource,variable...), optional quoted labels, and a body in braces. Lesson 14.1 - block label
- The quoted words after a block type. In
resource "azurerm_subnet" "app"the labels are the resource type and the local name. Lesson 14.1 - built-in function
- A built-in helper called as
name(arguments), e.g.lower("A"). Terraform has about 120 and you cannot write your own. Lesson 14.14 - can (can())
can(expr)is true if the expression works, false if it errors - used inside validation conditions. Lesson 14.14- check block (check)
- A top-level assertion that only warns when false, never blocking the run. For things that can drift over time. Lesson 14.8
- checkov (trivy)
- Security scanners that flag risky Terraform, like public storage or missing TLS (Ch 16). Lesson 14.24
- cidrsubnet (cidrsubnets, cidrhost)
- Functions that carve subnets out of a range (
cidrsubnet(prefix, newbits, netnum)) and pick an address in one (cidrhost). Lesson 14.14 - cloud
- A company that rents you infrastructure over the internet; you ask its API for a machine or a network and pay while it exists. Lesson 14.1
- cloud-init
- The standard program that runs a start-up script or config file on a new Linux VM the first time it boots. Lesson 14.11
- coalesce
coalesce(a, b)returns the first argument that is neither null nor an empty string. Lesson 14.14- conditional expression (ternary)
cond ? a : b- "if cond then a else b", the same as in JS. Lesson 14.11- configuration (Terraform configuration)
- All the .tf files in one directory. Terraform reads and merges every one of them; file names do not matter. Lesson 14.1
- configuration management
- Setting up what runs inside a machine (packages, files, services). Tools like Ansible do it; Terraform does not. Lesson 14.1
- count (count.index)
- A meta-argument that makes N copies addressed by position
[0],[1]... Removing one from the middle re-addresses all later ones. Lesson 14.20 - data source
- A read-only lookup of something that already exists and that Terraform does not own. Written
data "type" "name" {}, used asdata.type.name.attr. Lesson 14.1 - declarative
- Describing the end state you want ("this must exist") and letting the tool work out the steps. Terraform and systemd unit files are declarative. Lesson 14.1
- dependency graph (graph)
- The map of "what needs what" Terraform builds from references; it decides the order and what can run in parallel. Lesson 14.18
- dev, test, prod (environment, environments)
- Copies of the same system: dev for developers to break, test for checking, prod (production) the one real users use. Lesson 14.1
- disaster recovery (DR)
- A second copy of a system, usually in another region, for when the first one is down. Lesson 14.3
- drift
- When reality no longer matches the code, usually because someone changed it by hand in the portal. Found with
terraform plan -refresh-onlyor a nightlyplan -detailed-exitcode. Lesson 14.24 - dynamic block (dynamic)
- Generates repeated nested blocks (like firewall rules) from a collection, since nested blocks cannot be built with a for expression. Lesson 14.11
- ephemeral
- A value Terraform uses but never writes to state or plan files (Terraform 1.10+). Lesson 14.5
- expression
- Anything that computes a value: the right-hand side of
name = ..., from a literal to aforloop. Lesson 14.11 - flatten
flatten(list)turns a list of lists into one flat list. Lesson 14.14- flatten pattern
- Nested for expressions +
flatten+ a final{ for ... => ... }to turn parent/child data into one map for for_each. Lesson 14.20 - for expression
[for s in list : upper(s)]or{ for s in list : s.name => s }- builds a new list or map from another, like JS array.map. Lesson 14.11- for_each (each.key, each.value)
- A meta-argument that makes one copy per map key or set element, addressed by key
["web"]; removing one touches only that one. Lesson 14.20 - gate (approval gate)
- A step in a pipeline that stops it: a check that fails, or a human who must approve before apply. Lesson 14.24
- gRPC
- A standard way for two programs to call each other; Terraform core talks to providers with it. You never touch it. Lesson 14.3
- HCL (HashiCorp Configuration Language)
- Terraform's language: blocks in curly braces,
name = valuelines,#comments, and expressions. Lesson 14.1 - HCL argument
- A
name = valueline inside a block, a setting you write. Lesson 14.1 - HCP Terraform (HCP, Terraform Cloud)
- HashiCorp's hosted service that runs Terraform and stores state for teams (Ch 16). Lesson 14.8
- hub and spoke
- A network design: one central (hub) network for shared services like a firewall, and app (spoke) networks connected to it. Lesson 14.20
- immutable
- Cannot be changed in place, only replaced. A storage account name is immutable: a new name means destroy and create. Lesson 14.1
- imperative
- Describing the steps to take ("create this, then that"). A bash script is imperative; run it twice and it does everything twice. Lesson 14.1
- implicit dependency
- A dependency Terraform sees because one block references another. Lesson 14.18
- infrastructure
- The things applications run on: machines, networks, disks, databases, DNS names, firewall rules. Lesson 14.1
- Infrastructure as Code (IaC)
- Describing infrastructure in text files kept in git, so changes are reviewed, repeatable and can be undone like code changes. Lesson 14.1
- init -upgrade (terraform init -upgrade)
- Re-choose the newest provider versions the constraints allow and rewrite the lock file - the deliberate upgrade. Lesson 14.3
- input variable (var.)
- An input to a configuration, declared with
variable "name" {}and read asvar.name- like a function parameter. Lesson 14.5 - jsonencode (jsondecode)
- Turn a Terraform value into a JSON string (and back), instead of hand-writing JSON with escaped quotes. Lesson 14.14
- Key Vault
- An Azure locked box for secrets, keys and certificates; programs fetch secrets from it instead of keeping them in files. Lesson 14.3
- known after apply ((known after apply))
- A value that does not exist yet (an ID, an IP) and will only be known once apply creates the thing. Lesson 14.18
- lifecycle (lifecycle block)
- A nested block in a resource with settings for how Terraform treats it: preconditions, prevent_destroy, create_before_destroy... Lesson 14.8
- list
- An ordered collection of same-typed values, indexed from 0:
["a", "b"]. Lesson 14.8 - local (locals, local value, local.)
- A named value computed inside the configuration, read as
local.name- like a const. Cannot be set from outside. Lesson 14.5 - local name
- The second label of a resource, a nickname used only inside your code. It is not the cloud's name for the thing. Lesson 14.1
- local_file (hashicorp/local)
- A resource from the local provider that writes a file on this machine.
- lock file (.terraform.lock.hcl, dependency lock file)
- The file init writes with the exact provider versions chosen and their checksums. Commit it, like package-lock.json. Lesson 14.3
- lookup
lookup(map, key, default)- the value for a key, or the default if the key is missing. Lesson 14.14- LRS (GRS, replication)
- How many copies Azure keeps of stored data: LRS = three copies in one data centre; GRS (geo-redundant) also copies to a far-away region. Lesson 14.1
- managed identity
- A robot account Azure attaches to a machine, so programs on it can log in without any stored password. Lesson 14.3
- map
- Key = value pairs where every value has the same type:
{ web = 2, api = 3 }. Always iterated in key order. Lesson 14.8 - merge
merge(a, b, ...)combines maps into one; on duplicate keys the last one wins. Lesson 14.14- meta-argument
- An argument Terraform itself understands on any resource, not the provider:
count,for_each,depends_on,provider,lifecycle. Lesson 14.3 - motd (message of the day)
- The banner text printed when you log in to a Linux machine.
- moved block (moved)
- A block in the code saying a resource was renamed (
from->to), so the next apply moves it in state instead of destroying it. Lesson 14.20 - mutable
- Changed in place. A tag on a resource group is mutable: Terraform edits it without rebuilding anything. Lesson 14.1
- nested block
- A block inside another block, like
features {}in a provider orlifecycle {}in a resource. Lesson 14.1 - NSG (network security group)
- Azure's list of firewall rules (allow/deny by port and address) attached to a subnet or a machine. Lesson 14.8
- null argument
- No value. As an argument it means "not set", exactly as if the line were not there. Lesson 14.8
- nullable
nullable = falseon a variable: passing null uses the default instead of null. Lesson 14.8- object (object type)
- A value with named attributes, each with its own type - like a TypeScript interface. Unknown extra attributes are silently dropped. Lesson 14.8
- OIDC (OpenID Connect, workload identity federation)
- A way for a CI job to swap its own short-lived signed token for a cloud token, so no password is stored anywhere. Lesson 14.3
- one (one())
one(list)gives the only element of a 0-or-1 element list, or null if it is empty. Lesson 14.14- OpenTofu
- A community copy (fork) of Terraform 1.5 under an open-source licence; it works almost the same way. Lesson 14.1
- optional() (optional)
optional(type, default)inside an object type lets callers leave that attribute out; the default fills in. Lesson 14.8- output (output block, terraform output)
- A value a configuration prints and remembers after apply, like a return value.
terraform output -raw NAMEprints one for scripts. Lesson 14.5 - path.module
- The directory of the code the expression is in, so file paths work wherever the code is called from. Lesson 14.11
- pessimistic operator (~>)
~>lets only the rightmost number you wrote grow:~> 4.14allows 4.x from 4.14 up;~> 4.14.0allows only 4.14.x. Lesson 14.3- plugin cache (TF_PLUGIN_CACHE_DIR)
- A shared folder of downloaded providers so each directory does not download them again. Lesson 14.3
- portal (Azure portal)
- The cloud's website, where people can click resources into existence. Terraform replaces that clicking. Lesson 14.1
- postcondition
- A rule checked on the result (through
self) after a resource or data source is read or created. Lesson 14.8 - precondition
- A rule checked before a resource or output is planned; if false, the plan fails with your message. Lesson 14.8
- provider
- A plugin program that knows one platform's API (Azure, GitHub, random values, local files) and turns resource blocks into API calls. Lesson 14.1
- provider alias
- A second name for an extra configuration of the same provider (another region or subscription); resources pick it with
provider = azurerm.dr. Lesson 14.3 - provider block
- The
provider "name" { }block that configures a provider: which account, which features, never credentials. Lesson 14.3 - provider-defined function
- A function shipped by a provider, called as
provider::azurerm::name(...)(Terraform 1.8+). Lesson 14.14 - provisioning
- Creating the infrastructure itself (machines, networks, disks). Terraform provisions. Lesson 14.1
- random provider (random_pet, random_password, random_id)
- A provider that makes random values (names, passwords) locally without calling any API. Lesson 14.3
- reference
- Using another block's value, e.g.
azurerm_resource_group.main.name. It passes the value and tells Terraform what must exist first. Lesson 14.1 - refresh
- The first step of plan: ask the providers what each recorded object looks like right now. Lesson 14.24
- region (location)
- The place (a set of data centres) where a cloud resource lives, e.g.
westeuropein the Netherlands,northeuropein Ireland. Lesson 14.1 - REPL
- Read-eval-print loop: a prompt where you type code and see the result at once.
terraform consoleis one. Lesson 14.11 - replace (replacement, forces replacement)
- Destroy and re-create a resource because an attribute cannot change in place. Shown as
-/+and# forces replacementin a plan. Lesson 14.20 - required_providers
- The list of providers a configuration needs, with source and version constraint - like
dependenciesin package.json. Lesson 14.3 - required_version
- The Terraform versions a configuration accepts, e.g.
~> 1.9. An older binary refuses with a clear error. Lesson 14.1 - resource group
- In Azure, a named folder every other Azure thing must live in. Deleting it deletes everything inside. Lesson 14.1
- resource instance
- One copy of a resource that is created several times with count or for_each. Lesson 14.20
- resource tag (resource tags)
- A free-form label on a cloud resource, like
env = "dev"orowner = "platform". Changing tags never rebuilds anything. Lesson 14.1 - resource type
- The first label of a resource, e.g.
azurerm_storage_account. The part before the first underscore names the provider. Lesson 14.1 - role assignment
- An Azure permission grant: "this identity may do this role's actions on this thing" - like adding a user to a group, for the cloud. Lesson 14.18
- saved plan (plan file, tfplan, -out)
terraform plan -out=tfplanwrites the plan to a file;terraform apply tfplanapplies exactly that, with no prompt. Lesson 14.24- sensitive
sensitive = truehides a value in plan and apply output. It is still stored in plain text in state. Lesson 14.5- service endpoint (service_endpoints)
- An Azure subnet setting that gives the subnet a private path to an Azure service such as storage. Lesson 14.8
- service principal
- A robot user account in Azure for programs, which logs in with a password (client secret) or certificate. Lesson 14.3
- set
- A collection of unique values with no order and no index.
for_eachaccepts a set of strings. Lesson 14.8 - SKU
- Cloud-speak for a product tier or size, e.g.
StandardvsPremium. Lesson 14.8 - source address
- A provider's full name,
hostname/namespace/type, e.g.registry.terraform.io/hashicorp/azurerm(short:hashicorp/azurerm). Lesson 14.3 - splat ([*])
list[*].name- that attribute from every element. Works on lists, not on for_each maps. Lesson 14.11- stale plan
- A saved plan that can no longer be applied because state changed after it was made. Lesson 14.24
- state serial
- The state file's version counter; it goes up on every write. Lesson 14.24
- storage account
- An Azure place to keep files (blobs) in the cloud. Its name must be 3-24 lowercase letters and digits, unique worldwide. Lesson 14.1
- subscription
- Azure's billing account; every resource is created under one. Companies have several (dev, prod). Lesson 14.1
- template directive (%{ for }, %{ if })
%{ for ... }/%{ if ... }inside a string to loop or branch;~next to the braces removes the extra newline. Lesson 14.11- templatefile
templatefile(path, vars)renders a template file, seeing only the variables you pass it. Lesson 14.14- tenant
- A company's Azure directory of users and robot accounts. Its ID is the same for everyone in the company. Lesson 14.18
- Terraform
- A tool that builds and changes infrastructure from text files: you describe what should exist, it works out what to create, change or delete. One Go binary (
terraform) plus plugins called providers. Commands:init,validate,plan,apply,destroy. Lesson 14.1 - terraform apply (apply)
- Makes the changes from a plan and records the result in state. Asks for
yesunless given-auto-approveor a saved plan. Lesson 14.1 - Terraform Associate (Associate exam)
- HashiCorp's entry-level Terraform certification exam; this course covers its objectives across Ch 14-16. Lesson 14.1
- Terraform backend
- Where Terraform keeps its state file: a local file by default, or shared storage so a team uses one copy. Covered in depth in Ch 15. Lesson 14.1
- terraform block
- The
terraform { }block with settings for Terraform itself: required versions, providers and backend. Lesson 14.1 - terraform console
- An interactive prompt where you type an expression and see its value, like the browser JS console.
echo EXPR | terraform consolefor one value. Lesson 14.8 - Terraform core
- The main terraform program: reads the files, builds the graph, compares wanted with recorded, and calls providers. It knows nothing about any cloud itself. Lesson 14.1
- terraform destroy (destroy)
- Deletes everything this configuration manages, after showing the plan and asking for
yes. Lesson 14.1 - terraform fmt (fmt)
- Terraform's code formatter (like Prettier).
-checkchanges nothing and exits non-zero if files need formatting. Lesson 14.24 - terraform graph (DOT)
- Prints the dependency graph as DOT text: each
"A" -> "B"line means A depends on B. Lesson 14.18 - terraform init
- Prepares a directory: downloads providers (and modules), sets up the backend, writes the lock file. Changes no infrastructure. Lesson 14.1
- terraform plan (plan)
- Shows what Terraform would create, change or destroy to make reality match the code. Changes nothing. Lesson 14.1
- Terraform Registry (registry.terraform.io)
- The website Terraform downloads providers (and modules) from, like npm for Terraform. Lesson 14.3
- Terraform resource
- A block describing something Terraform creates, updates and destroys - it owns it. Lesson 14.1
- terraform show (show -json)
- Prints a saved plan or the state;
-jsongives machine-readable output for jq. Lesson 14.24 - Terraform state (state file, terraform.tfstate)
- The JSON file where Terraform records every resource it manages and the real cloud object it maps to. Holds every attribute in plain text, secrets included - never commit it. Ch 15 is about state. Lesson 14.1
- terraform state list
- Lists the address of every resource recorded in state.
- terraform state mv (state mv)
- Renames an entry in state (a new address) without touching the real object. Lesson 14.20
- terraform validate (validate)
- Offline check of the .tf files: syntax, names, references, types. It does not ask the cloud anything.
- TF_LOG (TF_LOG_PATH)
- Environment variables that turn on debug logging (
TF_LOG=DEBUG) and write it to a file (TF_LOG_PATH). Lesson 14.24 - TF_VAR_ (TF_VAR_name)
- Environment variables named
TF_VAR_<name>set input variables; they are the weakest real source. Lesson 14.5 - tflint
- A linter for Terraform: catches style problems and cloud-specific mistakes validate misses (Ch 16). Lesson 14.24
- tfvars (terraform.tfvars, .tfvars, *.auto.tfvars)
- A file of
name = valuelines giving variables their values. terraform.tfvars and *.auto.tfvars load automatically; others need-var-file. Lesson 14.5 - toset
toset(list)converts a list into a set (duplicates removed, order lost) - what for_each needs. Lesson 14.14- try (try())
try(a, b)returns the first argument that works without an error. null counts as working. Lesson 14.14- tuple type
- A fixed-length list where each position has its own type. A literal
["a", "b"]is a tuple until converted. Lesson 14.8 - type constraint (type)
- What kind of value a variable accepts: string, number, bool, list(...), set(...), map(...), object({...}), tuple([...]). Lesson 14.8
- validation (validation block)
- A rule inside a variable (
condition+error_message) that rejects bad input before anything is planned. Lesson 14.5 - variable precedence
- Which value wins when a variable is set in several places: default < TF_VAR_ < terraform.tfvars < *.auto.tfvars < -var/-var-file (last one wins). Lesson 14.5
- version constraint
- A rule for acceptable versions, e.g.
>= 4.0,~> 4.14,= 4.14.0. Lesson 14.3 - VM scale set
- A group of identical virtual machines Azure runs and resizes for you. Lesson 14.8
- VM size (size)
- A VM's t-shirt size: how many CPUs and how much memory, e.g.
Standard_B2s(2 CPUs, 4 GB). - VNet (virtual network)
- Your private network in Azure, with an address range (CIDR) like 10.0.0.0/16, split into subnets; Azure reserves 5 addresses in each subnet. Lesson 14.8
- web app (azurerm_linux_web_app)
- Azure's hosting for a web application: you give it code or an image, Azure runs it. Lesson 14.14
- workflow (core workflow)
- The loop you run: write, init, plan, apply (and destroy to remove everything). Lesson 14.1