All Tools View Categories About Contact Privacy

Terraform Output Block Generator

Build a single Terraform output block (HCL) for outputs.tf.

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

About Terraform Output Block Generator

Outputs expose values from a Terraform module so that other modules and humans can read them after an apply. The Terraform Output Block Generator writes one valid output block from a short form, so you do not have to recall the exact schema or worry about indentation. You set the output name and a value expression, which is emitted raw so you can reference any resource attribute such as aws_instance.web.id, a variable, or a literal. You can add an optional description that documents the output for readers of your module, mark the output as sensitive so Terraform hides its value in the CLI and state, and list resource addresses under depends_on when the output depends on resources that are not otherwise referenced. The generator validates the output name as a Terraform identifier, builds the HCL with the shared serializer, and shows the result in a preview you can copy, download as outputs.tf, or print. Everything runs locally in your browser; nothing is uploaded and no cloud account is contacted. This makes it a fast, safe way to scaffold correct output blocks while you are writing or refactoring a module. Outputs are also the bridge between a root module and the modules it calls, so getting the value expression right avoids a round trip of terraform plan runs. A well described, correctly named output is documentation that never goes stale. Because the HCL is produced by a shared serializer, the indentation and quoting always match what terraform fmt would accept, so the paste is clean on the first try.

Features

  • Raw value - the value expression is emitted exactly as typed, so references and literals both work.
  • Description - an optional sentence documents the output for module consumers.
  • Sensitive flag - mark the output sensitive to redact it in CLI and state output.
  • depends_on - a comma separated list of resource addresses becomes a list literal.
  • Identifier check - the output name is validated as a legal Terraform identifier.
  • Correct HCL - the block is built by the shared serializer so indentation is always right.
  • Instant preview - the generated block appears in the preview as you generate.
  • Copy, download, print - export outputs.tf wherever you need it.
  • Line stats - a stats row shows the size of the generated block.
  • Markdown export - copy the block as a fenced markdown snippet for docs.
  • Reusable block - the generated output drops into any module with no edits.
  • No network - generation is fully client side and offline safe.

How to Use

  1. Name the output with a valid Terraform identifier such as instance_id or vpc_arn.
  2. Set the value expression to a reference like aws_instance.web.id or to a literal you want to expose.
  3. Add a description if the output needs explanation for consumers of the module.
  4. Toggle sensitive when the value is a secret that should be hidden in the CLI and state.
  5. List depends_on addresses, comma separated, when the output relies on unreferenced resources.
  6. Click Generate HCL to build the block and view it in the preview.
  7. Export the result with Copy, Copy as Markdown, Download, or Print, then paste it into your outputs.tf.
  8. Re-run after edits whenever you change the form so the preview, stats, and exports stay in sync with your inputs.

Examples

Example 1 - instance id. Name instance_id with value aws_instance.web.id produces a clean output block exposing the id of the instance.

Example 2 - sensitive secret. Marking the output sensitive emits sensitive = true so Terraform redacts the value in plans and apply output.

Example 3 - depends_on. Listing aws_instance.web under depends_on emits a depends_on list so the output is created after that resource.

Example 4 - described output. Adding a description emits a description attribute that documents the output for readers.

Example 5 - literal value. A value of a plain string is emitted as a quoted literal, which is handy for exposing a computed name built elsewhere.

Benefits

  • Correct schema - the block always follows the output syntax.
  • Flexible value - raw references or literals are both supported.
  • Validated name - illegal identifiers are caught before they reach a plan.
  • Private - everything runs in the browser with no upload.
  • Fast scaffolding - generate a block in one click while editing.
  • Portable - copy, markdown, download, or print the result.
  • Consistent docs - descriptions keep module interfaces self documenting.
  • Offline safe - works without any registry or cloud access.

Frequently Asked Questions

What does this tool generate?
It writes one output block with the name, value expression, optional description, sensitive flag and depends_on list.
What goes in value?
Any HCL expression: a resource attribute (aws_instance.web.id), a variable, or a literal. It is emitted raw.
How is depends_on handled?
Provide a comma-separated list of resource addresses; they become a list literal.
Does this connect to a cloud?
No. Everything is assembled in your browser and nothing is uploaded.
Can I download it?
Yes. Copy the HCL, download outputs.tf, or print it.