All Tools View Categories About Contact Privacy

Terraform Makefile Generator

Build a Makefile with init, plan, apply, destroy, fmt and validate targets.

Runs entirely in your browser - nothing is uploaded and no cloud connection is made.
0
targets
Your generated Makefile will appear here.

About Terraform Makefile Generator

A Makefile is the simplest way to give a Terraform project a single, memorable entry point for its most common workflows. The Terraform Makefile Generator scaffolds a correct Makefile with init, plan, apply, destroy, fmt, validate and output targets, each running the matching Terraform command through a single overridable binary variable. Instead of remembering flags and typing long commands, your team runs make plan and moves on.

Pick the targets you want, optionally set the binary (the default is terraform, but make TF=tofu swaps in OpenTofu without editing the file), and the generator emits a real Makefile with tab-indented recipes and a correct .PHONY declaration. Everything is assembled in your browser, so nothing is uploaded and no shell is executed. It is ideal for bootstrapping a repository, standardising commands across many modules, or handing a consistent interface to contributors who do not know Terraform deeply.

Because the output is a plain Makefile, it works on any machine with make installed and pairs naturally with CI. The live target count and an optional help target mean the file documents itself: running make or make help lists what is available, which is a small but real win for onboarding.

The generator also plays well with continuous integration. Because the recipe for every target is just $(TF) command, you can drop the generated Makefile into a CI job and call make plan or make validate without remembering provider-specific invocations. When a project later migrates from Terraform to OpenTofu, flipping the binary is a one-line change rather than a search across every script.

Another quiet advantage is reviewability: a Makefile is plain text that diffs cleanly, so a reviewer can see exactly which workflows a repository exposes and whether a dangerous target like destroy is gated behind a prompt or a guard. Keeping those decisions in a shared file, rather than in everyone’s shell history, makes the team’s operational contract explicit and auditable.

Features

  • Common targets - init, plan, apply, destroy, fmt, validate, output.
  • TF variable - override the binary with make TF=tofu.
  • Tab-safe - real tab recipe indentation, required by make.
  • .PHONY - correct phony declaration for all targets.
  • Help target - optional self-documenting make help target.
  • Live count - a stat shows how many targets are selected.
  • CI ready - recipes are plain $(TF) commands that drop into any pipeline.
  • Consistent interface - the same commands work across every module in a repo.
  • Copy / Download / Print - export the Makefile.
  • Copy as Markdown - a fenced block for docs and READMEs.
  • Word-wrap toggle - keep long recipes readable.
  • Private - assembled in your browser, nothing leaves the page.

How to Use

  1. Set the Terraform binary (default terraform) in the input box.
  2. Select the targets you want from the checklist.
  3. Optionally enable help to add a self-documenting target.
  4. Click Generate Makefile to build the file.
  5. Review the target count on the right.
  6. Toggle word wrap if a recipe line is long.
  7. Use Copy Markdown to paste the Makefile into a README.
  8. Export by copying, copying Markdown, downloading or printing.
  9. Load a sample or clear to reset the form.

Examples

Example. Select every target with the default binary. The generator emits TF ?= terraform, a .PHONY line listing all seven targets, and one tab-indented recipe per target such as plan: followed by $(TF) plan. The target count reads seven. Enabling help adds a target that prints the available commands, so a newcomer who runs make sees exactly what the project supports without opening the file.

The same file is easy to extend: add a target such as fmt-check by following the generated pattern, so a teammate can add custom targets without guessing make syntax. The live target count updates as you toggle checkboxes, so you always know how many workflows the file will expose before you download it. You can also generate the file for OpenTofu by typing tofu in the binary box; the only change is the first line, TF ?= tofu, and every recipe still works because they all reference the $(TF) variable rather than a hardcoded name.

Benefits

  • Convenient - one command for each workflow.
  • Portable - works with terraform or tofu via the TF variable.
  • Correct - valid Makefile syntax with real tabs.
  • Self-documenting - an optional help target lists commands.
  • CI friendly - recipes slot into pipelines unchanged.
  • Migratable - switch terraform to tofu with a single variable.
  • Onboarding - new contributors learn one command set.
  • Auditable - exposed workflows are visible in version control.
  • Private - runs fully in the browser.

Frequently Asked Questions

What does this tool generate?
It builds a Makefile exposing common Terraform workflows (init, plan, apply, destroy, fmt, validate, output) as make targets, with a TF variable you can override.
Why a TF variable?
TF ?= terraform lets you run make TF=tofu plan to use an alternate binary without editing the file.
Are recipe lines tab-indented?
Yes. Make requires tabs for recipe lines and the generator emits real tab characters.
What is .PHONY for?
It declares the targets as not corresponding to files so make always runs them.
Does this upload anything?
No. Everything is assembled in your browser and nothing leaves your machine.
Can I download the result?
Yes. Copy the Makefile, download it, or print it.