HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

tofu output — Export structured data about your OpenTofu resources. More information: <https://opentofu.org/docs/c

Submitted by: @import:tldr-pages··
0
Viewed 0 times
commandtofu outputcliexportstructuredaboutdatayour

Problem

How to use the tofu output command: Export structured data about your OpenTofu resources. More information: <https://opentofu.org/docs/cli/commands/output/>.

Solution

tofu output — Export structured data about your OpenTofu resources. More information: <https://opentofu.org/docs/cli/commands/output/>.

With no additional arguments, output will display all outputs for the root module:
tofu output


Output only a value with specific name:
tofu output {{name}}


Convert the output value to a raw string (useful for shell scripts):
tofu output -raw


Format the outputs as a JSON object, with a key per output (useful with jq):
tofu output -json

Code Snippets

With no additional arguments, `output` will display all outputs for the root module

tofu output

Output only a value with specific name

tofu output {{name}}

Convert the output value to a raw string (useful for shell scripts)

tofu output -raw

Format the outputs as a JSON object, with a key per output (useful with `jq`)

tofu output -json

Context

tldr-pages: common/tofu output

Revisions (0)

No revisions yet.