Skip to content
Novus Examples
tfvars405 B

Terraform Default terraform.tfvars

A terraform.tfvars assigning the staging defaults, including a nested map-of-objects value. Pairs with the production overrides file, which replaces that map wholesale rather than merging into it.

Preview — first 23 linestfvars
# Default variable values. Paired with production.tfvars, which overrides a subset.
environment    = "staging"
region         = "eu-example-1"
instance_count = 2
instance_size  = "small"

subnets = {
  app-a = {
    cidr = "10.20.1.0/24"
    zone = "a"
  }
  app-b = {
    cidr   = "10.20.2.0/24"
    zone   = "b"
    public = true
  }
}

tags = {
  owner = "example-platform-team"
  tier  = "standard"
}

Specifications

Role
defaults
Assignments
6
Nested Objects
2
Environment
staging

Testing contract

Reference control
Scenario
Parse a tfvars file into variable assignments without a Terraform binary
Expected result
Six assignments resolve and the subnets value parses as a map of two objects, one of which sets the optional public attribute

What is a .tfvars file?

A .tfvars file supplies values for the variables a Terraform configuration declares. It uses the same HCL grammar but permits only top-level `name = value` assignments — strings, numbers, booleans, lists, and objects — with no blocks or expressions. Files named terraform.tfvars or *.auto.tfvars are loaded automatically; others must be passed explicitly.

How to use this file

Use an example .tfvars file to test variable-file parsers and configuration tooling, verifying type coercion, complex object and list values, and that assignment precedence between auto-loaded, explicit, and environment-supplied values is applied correctly.

How to use this file for testing

“Terraform Default terraform.tfvars” is a deterministic Novus Examples fixture for Config testing, Config parsing, Syntax highlighting. TOML, INI, YAML, .env, and dotfile configuration samples with nested sections and typed values — for testing config parsers, loaders, and environment tooling.

Documented properties for this file: defaults. Compare results against paired or grouped companions on this page when present (clean↔damaged, searchable↔scanned, or format twins) so scores stay reproducible across runs.

Download the file once, keep the path stable in CI or local scripts, and treat the spec table as the contract: dimensions, seeds, field lists, and roles are intentional. Corrupt or invalid samples are labelled as such — expect parsers to fail loudly rather than silently accept them.

Pipeline and infrastructure fixtures are inert configuration: steps reference fictional images and scripts, and nothing here executes. Run your linter, schema validator, migrator, or policy engine against them, and expect the deprecated-syntax and intentionally invalid variants to be rejected.

Point your config loader at the file and assert it reads the documented sections and typed values, including any deliberately-tricky nesting or comments.

Generated by generation/pipelines.py. Free for any use, no attribution required — license.