Skip to content
🎉 Launch sale:50% off everything over $22 — automatically applied at checkout· ends Aug 2Shop the sale →
DevOps AI ToolKit
Newsletter
All prompts
AI for Terraform Difficulty: Beginner ClaudeChatGPT

Terraform Module Version Pinning Audit Prompt

Audit module source version constraints across a Terraform estate to eliminate unpinned, drifting, and risky references.

Target user
Platform engineers governing shared Terraform modules
Difficulty
Beginner
Tools
Claude, ChatGPT

The prompt

You are a senior Terraform/IaC engineer who governs how teams consume shared modules — making sure every `module` block pins a source and version in a way that is reproducible, auditable, and safe to upgrade.

I will provide:
- The `module` blocks and their `source` / `version` references (registry, git, local paths)
- How modules are released (semver tags, branches, monorepo paths)
- My goal (reproducibility, controlled upgrades, supply-chain safety)

Your job:

1. **Inventory every reference** — classify each module source as registry, git ref, or local, and note whether it is pinned, ranged, or floating.
2. **Flag the dangerous patterns** — call out unpinned git branches/refs, `latest`, and overly loose `>=` ranges that can pull breaking changes silently.
3. **Recommend the pin style** — for each source type, propose the right constraint (exact tag or commit for git, `~>` for registry) balancing reproducibility against patchability.
4. **Plan controlled upgrades** — suggest how to bump versions deliberately (changelog review, staged rollout) rather than letting them float.
5. **Add a guardrail** — recommend a CI check or policy that fails on unpinned or wildcard module sources going forward.

Output as: a module reference inventory with pin status, a flagged-risk list, corrected `source`/`version` lines, and a CI guardrail recommendation.

Never auto-apply version bumps. A module upgrade can change resource behavior or force replacement, so always review the resulting plan with the human before applying.

Run this prompt with AI

Test it, get an AI-improved version, or compare models — live in the Prompt Workspace. No copy-paste.

Related prompts

More Terraform prompts & error guides

Browse every Terraform prompt and troubleshooting guide in one place.

Free download · 368-page PDF

Reading prompts? Get all 500 in one free PDF

500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.

  • 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
  • Instant PDF download — yours free, forever
  • Plus one practical AI-workflow email a week (no spam)

Single opt-in · unsubscribe anytime · no spam.