Terraform Module Generator
Scaffold a reusable module’s main.tf/variables.tf/outputs.tf from a list of variable and output names, runs entirely in your browser.
About this tool
Different from the Terraform Variable Generator tool: that one produces a single, fully-typed variables.tf for a root module. This one scaffolds the three-file layout a reusable child module conventionally has (main.tf, variables.tf, outputs.tf), with simple name-only input variables and output placeholders, the skeleton you fill in with real resources.
Enter a module name, a comma-separated list of input variable names, and an optional comma-separated list of output names, and get back all three files: main.tf with a TODO placeholder resource referencing your first variable, variables.tf with a string-typed variable block per name, and outputs.tf with a placeholder output block per name (or a comment noting none are defined yet).
Frequently asked questions
- How is this different from the Terraform Variable Generator tool?
- That tool is for a root module’s variables.tf: fully typed (string, number, bool, list, map) with real defaults and descriptions. This tool scaffolds an entire child module’s file layout (main.tf, variables.tf, outputs.tf) as a starting skeleton, with simple string-typed variables meant to be refined once real resources are added.
- Why is main.tf just a placeholder resource?
- A module’s actual resources depend entirely on what it is meant to manage, which nothing in a name/variable list can tell this tool. The placeholder marks exactly where real resource blocks belong and shows how to reference an input variable (var.name) from inside them.
- Why do the output blocks reference a placeholder resource?
- Once you replace the placeholder in main.tf with real resources, update each output’s value to reference the actual resource attribute you want to expose (e.g. aws_instance.this.id) instead of the placeholder’s id.
- Is my input sent anywhere?
- No. Every file is assembled entirely in your browser, no network request is made.
Continue learning
- DocumentationTerraform BasicsHow Terraform's state model, providers, and plan/apply workflow make infrastructure reviewable like code, plus the state pitfalls that trip up teams.
- BlogTerraform Troubleshooting Guide: Fix the Errors Engineers Actually HitDiagnose Terraform initialization, validation, provider, authentication, state, drift, import, replacement, timeout, and CI failures with a safe workflow.
- ToolTerraform Variable GeneratorBuild a variables.tf from a list of name/type/description/default rows, runs entirely in your browser.
- DocumentationBash FundamentalsBash scripting from variables to functions, plus the quoting and exit-status habits that separate a script that looks right from one that fails safely.
- BlogHow to Build a Production-Ready Azure Environment with TerraformBuild an Azure foundation with Terraform remote state, controlled outbound access, private endpoints, Key Vault, Storage, monitoring, verification, and cleanup.
- ToolDockerfile GeneratorGenerate a working Dockerfile for Node.js, Python, Go, or a static site, runs entirely in your browser.