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

terraform output — Export structured data about your Terraform resources. More information: <https://developer.hashicor

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

Problem

How to use the terraform output command: Export structured data about your Terraform resources. More information: <https://developer.hashicorp.com/terraform/cli/commands/output>.

Solution

terraform output — Export structured data about your Terraform resources. More information: <https://developer.hashicorp.com/terraform/cli/commands/output>.

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


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


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


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

Code Snippets

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

terraform output

Output only a value with specific name

terraform output {{name}}

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

terraform output -raw

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

terraform output -json

Context

tldr-pages: common/terraform output

Revisions (0)

No revisions yet.