terraform/website/source/docs/commands/output.html.markdown

32 lines
1.1 KiB
Markdown
Raw Normal View History

2014-07-25 00:44:10 +02:00
---
layout: "docs"
page_title: "Command: output"
sidebar_current: "docs-commands-output"
2014-10-22 05:21:56 +02:00
description: |-
The `terraform output` command is used to extract the value of an output variable from the state file.
2014-07-25 00:44:10 +02:00
---
# Command: output
The `terraform output` command is used to extract the value of
an output variable from the state file.
## Usage
Usage: `terraform output [options] NAME`
2014-11-21 08:00:02 +01:00
By default, `output` requires only a variable name and looks in the
2014-07-25 00:44:10 +02:00
current directory for the state file to query.
The command-line flags are all optional. The list of available flags are:
* `-json` - If specified, the outputs are formatted as a JSON object, with
a key per output. This can be piped into tools such as `jq` for further
processing.
2014-07-25 00:44:10 +02:00
* `-state=path` - Path to the state file. Defaults to "terraform.tfstate".
2015-05-27 17:11:31 +02:00
* `-module=module_name` - The module path which has needed output.
By default this is the root path. Other modules can be specified by
a period-separated list. Example: "foo" would reference the module
"foo" but "foo.bar" would reference the "bar" module in the "foo"
module.