Terraform Required Providers and Backend
The 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.
terraform {
required_version = ">= 1.6.0, < 2.0.0"
required_providers {
examplecloud = {
source = "example-org/examplecloud"
version = "~> 2.4"
}
local = {
source = "hashicorp/local"
version = ">= 2.4.0"
}
}
backend "local" {
path = "terraform.tfstate"
}
}
provider "examplecloud" {
region = var.region
# Credentials are supplied by the environment at run time.
# This fixture deliberately contains none.
default_tags {
tags = {
managed_by = "terraform"
fixture = "novus-examples"
}
}
}
provider "examplecloud" {
alias = "secondary"
region = var.secondary_region
}
Specifications
- Terraform Version
- >= 1.6.0, < 2.0.0
- Providers
- 2
- Provider Aliases
- 1
- Backend
- local
- Has Default Tags
- true
- Credentials
- none
Testing contract
Expected to pass- Scenario
- Read a Terraform configuration's version constraints, backend, and provider aliases
- Expected result
- Two providers resolve with distinct version constraint operators, and the aliased examplecloud.secondary configuration is recognised as a second instance of the same provider
What is a .tf file?
A .tf file is a Terraform configuration written in HCL. It declares infrastructure as blocks — terraform, provider, resource, data, variable, output, module, locals — whose bodies hold arguments and nested blocks, with values drawn from expressions, interpolation, and functions. Terraform reads every .tf file in a directory as one merged configuration, so ordering across files carries no meaning.
How to use this file
Use an example .tf file to test HCL parsers, infrastructure linters and policy engines, and configuration migrators, checking block-and-label parsing, heredoc strings, expression references between resources, and that a deprecated-syntax file is flagged rather than silently accepted.
How to use this file for testing
“Terraform Required Providers and Backend” 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: TF · 665 bytes. 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
- tfvarsTerraform Default terraform.tfvarsA 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.

- 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 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.