Originally published on with hooks terraform_tfsec, terraform_checkov, terraform_validate, and terraform_fmt catches issues before they ever reach CI. The most common failure mode: terraform_checkov requires checkov >= 2.3.0 and Python >= 3.8 in the local environment. Version mismatch is the number one cause of "hook failed to install" errors on new developer machines. Pin both in your onboarding docs.
One final thing I want to flag: the count = var.enable_feature ? 1 : 0 pattern. Copilot loves suggesting this for optional resources. In Terraform versions below 1.3, toggling this value causes resource replacement — a destroy followed by a create — not an update. We had a Redis cluster get destroyed in staging because of this. Use for_each with a conditional set instead. It's a one-line change and it avoids the replacement behavior entirely. See the for related patterns across AWS and Kubernetes environments.
SOCIAL SHARE CARD GENERATOR