Terraform Module Registry Publishing Prompt
Publish a reusable module to a public or private registry the right way — repo naming and structure, semantic version tags, examples and docs, automated release, and a consumer-friendly versioning policy.
- Target user
- Module authors publishing to Terraform Cloud, public, or private registries
- Difficulty
- Intermediate
- Tools
- Claude, ChatGPT
The prompt
You are a module author who has shipped widely-consumed Terraform modules and knows that a registry module is a product: it needs a stable interface, real docs, runnable examples, and disciplined versioning. I will provide: - The module's purpose and current repo layout - Target registry (public registry.terraform.io, Terraform Cloud private, or a private registry) - Source control host (GitHub/GitLab) and CI available - Intended audience (internal teams, public) Your job: 1. **Registry requirements** — confirm the non-negotiables: repo naming `terraform-<PROVIDER>-<NAME>`, a tagged semver release (`v1.2.3`), standard files at root (`main.tf`, `variables.tf`, `outputs.tf`, `README.md`), and the `examples/` and `modules/` (submodules) conventions. Flag anything my layout is missing. 2. **Interface stability** — review variables and outputs as the public contract. Push for sensible defaults, validated inputs, typed variables, and clearly-described outputs so consumers don't read the source to use it. 3. **Examples that double as tests** — require at least one minimal and one complete example under `examples/`, each runnable, so the registry renders them and CI can plan/apply them. 4. **Docs generation** — wire `terraform-docs` to auto-generate the inputs/outputs tables into the README, plus a usage snippet with a pinned version constraint. The README is the registry landing page. 5. **Semantic versioning policy** — define breaking (remove/rename/retype a variable or output, raise the min Terraform version) vs minor (additive) vs patch (bugfix). Map each to the tag bump and a CHANGELOG entry, and recommend consumers pin with `~>`. 6. **Automated release** — set up CI to lint, validate, run example plans, then tag and publish on merge (release-please/semantic-release or a manual tag workflow). Include the GPG/signing or provider checks the public registry expects. 7. **Deprecation path** — how to retire a variable or a whole module version without breaking pinned consumers (alias, warn, drop after a major). Output: (a) a gap checklist against registry requirements, (b) the corrected repo tree, (c) terraform-docs + CI release config, (d) a versioning/CHANGELOG policy, (e) a consumer usage snippet with pinned version. Bias toward: stable interfaces, runnable examples, and semver discipline that lets consumers upgrade fearlessly.
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
-
Terraform Module Version Pinning Audit Prompt
Audit module source version constraints across a Terraform estate to eliminate unpinned, drifting, and risky references.
-
Terraform Module SemVer & Release Strategy Prompt
Define a semantic-versioning and release process for an internal Terraform module library — what counts as breaking, how to tag, deprecate inputs, and let consumers pin safely across a fleet of root modules.
-
Terraform Module Output Contracts Prompt
Design stable, well-typed module outputs that downstream modules can depend on — output naming, sensitive marking, object vs flat outputs, and versioning the contract so consumers don't break on every refactor.
-
Terraform for_each Set vs Map Keys Prompt
Decide whether a `for_each` should iterate a set of strings or a map of objects so instance keys stay stable, readable, and free of churn when the collection changes.
More Terraform prompts & error guides
Browse every Terraform prompt and troubleshooting guide in one place.
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.