Skip to content
Sarj Repo Standards

terraform-module-layout

Keep interfaces inside their owning module.

Examples

Keep declarations in the owning module folder

Before — rejected · error
{"manifest":"repository_id = \"example-repository\"\ncomponents = []\n","tracked":["infra/main.tf","infra/variables/region.tf"]}
After — preferred
{"manifest":"repository_id = \"example-repository\"\ncomponents = []\n","tracked":["infra/main.tf","infra/variables.tf"]}

Enable this rule

Add the stable ID to enabled_rules in your tracked .repo-standards/repository.toml:

enabled_rules = ["repository/terraform/module-layout"]

This selects only this rule. To retain the defaults, also include repository/artifacts/untyped-javascript and repository/artifacts/bespoke-iac-verifiers, along with any existing IDs. Omitted or empty selections use the defaults. Setup and staged checks

References