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.
# 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.
Related files
- tfTerraform Locals, for Expressions, and dynamic BlocksThe expression-heavy half of the stack: for expressions producing both a map and a filtered list, conditional expressions selecting whole objects, and a dynamic block that generates two firewall rules from a local list.

- tfTerraform Module Calls with Meta-ArgumentsThree module calls covering the shapes a dependency grapher has to handle: a local path with explicit provider passing, a versioned registry source under for_each, and a count-gated conditional module.

- tfTerraform Outputs and Splat ExpressionsFive Terraform outputs exercising a splat expression over a counted resource, a for expression over a for_each module, and a sensitive output that must stay redacted when propagated from a sensitive input.

- tfvarsTerraform Production tfvars OverridesThe production tfvars overrides. Its point is a semantic that surprises people: a complex-typed variable is replaced whole, not deep-merged, so the staging app-b subnet does not survive the override.

- tfTerraform Required Providers and BackendThe terraform settings block: a version constraint range, two pinned providers, a local backend, default tags, and a second aliased provider configuration. The fictional examplecloud provider means nothing resolves to a real service.

- tfTerraform Resources with count and for_eachThe resource graph: a network, a for_each subnet set, a counted instance resource, a data source, and a bucket on an aliased provider. Both repetition meta-arguments appear, plus lifecycle and an explicit depends_on edge.

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