github.com/bfallik/terraform@v0.7.1-0.20160814101525-d3a4714efbf5/website/source/docs/commands/output.html.markdown (about)

     1  ---
     2  layout: "docs"
     3  page_title: "Command: output"
     4  sidebar_current: "docs-commands-output"
     5  description: |-
     6    The `terraform output` command is used to extract the value of an output variable from the state file.
     7  ---
     8  
     9  # Command: output
    10  
    11  The `terraform output` command is used to extract the value of
    12  an output variable from the state file.
    13  
    14  ## Usage
    15  
    16  Usage: `terraform output [options] [NAME]`
    17  
    18  With no additional arguments, `output` will display all the outputs for the root module.
    19  If an output `NAME` is specified, only the value of that output is printed.
    20  
    21  The command-line flags are all optional. The list of available flags are:
    22  
    23  * `-json` - If specified, the outputs are formatted as a JSON object, with
    24      a key per output. If `NAME` is specified, only the output specified will be
    25      returned. This can be piped into tools such as `jq` for further processing.
    26  * `-state=path` - Path to the state file. Defaults to "terraform.tfstate".
    27    Ignored when [remote state](/docs/state/remote/index.html) is used.
    28  * `-module=module_name` - The module path which has needed output.
    29      By default this is the root path. Other modules can be specified by
    30      a period-separated list. Example: "foo" would reference the module
    31      "foo" but "foo.bar" would reference the "bar" module in the "foo"
    32      module.