Skip to content
Novus Examples
tf734 B

Terraform Outputs and Splat Expressions

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

Preview — first 26 linestf
output "network_id" {
  description = "Identifier of the primary network."
  value       = examplecloud_network.main.id
}

output "subnet_cidrs" {
  description = "Subnet CIDR blocks keyed by subnet name."
  value       = local.subnet_cidrs
}

output "instance_names" {
  description = "Names of every application instance."
  value       = examplecloud_instance.app[*].name
}

output "cache_endpoints" {
  description = "Cache endpoints for each region, from the for_each module."
  value       = { for region, mod in module.regional_cache : region => mod.endpoint }
}

output "admin_note" {
  description = "Echoes the sensitive input to exercise sensitive-output propagation."
  value       = var.admin_note
  sensitive   = true
}

Specifications

Outputs
5
Splat Expressions
1
For Expressions
1
Sensitive Outputs
1

Testing contract

Expected to pass
Scenario
Resolve Terraform output expressions and track sensitivity propagation
Expected result
The splat output yields one name per counted instance, and admin_note is reported sensitive because its source variable is

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 Outputs and Splat Expressions” 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 · 734 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.

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