TFNFR42 - Required Examples

ID: TFNFR42 - Category: Testing - Required Examples

Terraform module owners MUST provide executable examples under direct examples/<name>/ roots.

Module classRequired exampleOptional example
Resourceexamples/defaults/ and examples/waf-aligned/Additional examples
Patternexamples/defaults/examples/waf-aligned/ and additional examples
Utilityexamples/defaults/examples/waf-aligned/ and additional examples

The exact baseline spelling is defaults. default is retained only for migration compatibility with existing tooling and repositories; new modules MUST use defaults.

Each required example MUST:

  • deploy and destroy successfully without interactive input;
  • use required and applicable conditional module inputs;
  • rely on module defaults for optional inputs not needed by the scenario;
  • keep test-harness prerequisites, deployment scope, and dependency resources separate from module scenario inputs;
  • keep telemetry controls explicit and separate, including enable_telemetry and a required location when needed;
  • not contain .e2eignore.

Terraform submodules MUST NOT require separate example trees. Parent examples MUST exercise submodule behavior that is part of the module scenario.

The new Terraform composition check may report warnings for missing or misplaced examples. It is advisory only and MUST NOT be treated as a merge or release gate. Existing required-example workflow gates remain unchanged.

An example named waf-aligned does not prove semantic WAF compliance. The scenario must implement or arrange the applicable recommendations described by SFR2.