name: terraform-hygiene description: Validate Terraform changes against current docs and block deprecated settings in this repo. Use when tasks touch infra/*.tf, .terraform.lock.hcl, Terraform CI validation, or Terraform workflow/docs changes.
Terraform Hygiene
Overview
Use this skill when work touches Terraform in this repository. The goal is to keep provider syntax current and make deprecations fail locally and in CI instead of slipping through as warnings.
Workflow
-
Identify the touched Terraform surface first:
- provider resources and data sources under
infra/*.tf - Terraform workflows under
.github/workflows/** - lockfile changes in
infra/.terraform.lock.hcl
- provider resources and data sources under
-
Fetch current docs before editing:
- For provider resources or data sources, use Terraform MCP
search_providersthenget_provider_details. - For Terraform Registry modules, use Terraform MCP
search_modulesthenget_module_details. - Prefer the exact provider version already pinned by the repo when the docs allow version targeting.
- For provider resources or data sources, use Terraform MCP
-
If the docs are ambiguous:
- Run backendless
terraform initwith a dedicatedTF_DATA_DIR. - Inspect
terraform providers schema -jsoninstead of guessing block or attribute names.
- Run backendless
-
After edits:
- Run
python3 scripts/terraform_validate_strict.py. - Do not stop at plain
terraform validatesuccess if deprecated arguments or blocks are still reported.
- Run
-
If a deprecation cannot be resolved cleanly:
- Stop and surface the exact warning and the doc or schema conflict instead of guessing.
Repo Notes
- The strict local command is
python3 scripts/terraform_validate_strict.py. - Shared CI uses the same command through
.github/workflows/_terraform-validate-shared.yml. - Deprecation warnings are blocking in this repo even when Terraform itself exits with success.