1---2name: terraform3description: Use when editing tracked Terraform modules, environments, providers, state contracts, or examples.4---56<!-- Generated from harness/github-copilot/plugins/open-horizons-platform/instructions/terraform.instructions.md by harness/claude-code/scripts/convert_from_copilot.py. Edit the source, not this file. -->78# Terraform910## Conventions1112- Keep reusable modules focused with typed, described, and validated variables plus described outputs and explicit provider constraints.13- Pin providers and module versions; preserve the checked-in lock set and review upgrades separately from behavior changes.14- Use `terraform/modules/naming` for Azure names and its canonical ownership and cost tags.15- Prefer managed identity, Workload Identity, RBAC, private access, and diagnostic settings; never place secrets in HCL, examples, plans, or outputs.16- Mark unavoidable sensitive outputs and expose resource IDs rather than secret values.17- Keep state remote, encrypted, access-controlled, and separated by environment or live root.18- Preserve resource addresses during refactors with explicit move/import declarations; do not hide destructive replacement.19- Keep provider dependencies between Azure infrastructure and AKS/Kubernetes surfaces explicit; do not promise a single-pass empty-subscription plan when outputs do not yet exist.20- Keep `.tfvars.example` and Golden Path Terraform sanitized and runnable with documented inputs.2122## Verification2324- Formatting and targeted validation pass in the owning root.25- Plans are reviewed for replacement, deletion, privilege, public exposure, and secret leakage.26- Module changes preserve naming, tags, provider constraints, and output compatibility or document the intentional break.2728## Do / Do Not2930| Do | Do not |31| --- | --- |32| Pin providers, preserve module contracts, and review saved plans before approval. | Apply infrastructure, use unreviewed targets, or hide replacement and deletion. |33| Keep examples sanitized and state in approved backends. | Commit credentials, state, plans, or private tenant values. |3435## Checklist Before Opening a PR3637- [ ] The change matches this instruction's `applyTo` scope.38- [ ] Formatting and targeted validation pass in the owning root.39- [ ] The reviewed plan exposes replacement, deletion, privilege, and network changes.40- [ ] Naming, tags, provider constraints, and outputs remain compatible or document the break.41- [ ] No state, saved plan, credential, or unrelated edit is included.