<One sentence: what this infrastructure provisions and for which environments.>
Stack
- Terraform
(version pinned in `versions.tf`), providers: <aws | google | azurerm> -
Remote state: <S3 + DynamoDB lock GCS Terraform Cloud>; environments: envs/<dev|staging|prod>/
Commands
- Format:
terraform fmt -recursive - Validate:
terraform init -backend=false && terraform validate - Plan:
terraform -chdir=envs/<env> plan -out=tfplan - Lint/security:
<tflint>,<checkov -d .>or<trivy config .>
Rules
- Never run
terraform applyordestroy. Produce a plan and stop; a human applies. - Never edit state by hand or run
terraform state rm/mvwithout explicit approval. - Reusable pieces go in
modules/with typed variables, descriptions and outputs; environments only compose modules. - Pin provider and module versions; upgrade deliberately.
- Tag every resource with <owner, env, cost-center>.
- No secrets in
.tfor.tfvarsfiles; read them from the secret manager or pass via environment. - Prefer
for_eachovercountfor collections so resources keep stable addresses. - Read every plan for
destroy/replaceactions and call them out explicitly.
Definition of done
fmt,validateand linters pass; plan output summarized with any replacements or deletions highlighted.