5.3. Managing Module Versions
💡 First Principle: Unpinned module versions turn every terraform init -upgrade into a gamble — a new release could change behavior under you — so version constraints are how you trade "always newest" for "predictable and reviewable."
Why care: Version pinning is both a 004 objective and a real operational safeguard. The exam tests where the version argument applies and how constraints behave, mirroring provider versioning but with module-specific gotchas.
The mental model: Pinning a module version is like pinning a dependency in a lockfile-driven project — you decide when to take an upgrade rather than getting swept along with whatever's latest.
⚠️ Common Misconception: "Module versions auto-update to the latest on every run." They don't — Terraform installs a version satisfying your constraint at init, and only re-resolves to newer versions when you run terraform init -upgrade. Without a version constraint on a registry module, though, you risk pulling whatever's newest on a fresh init.