diff --git a/website/source/docs/commands/agent.html.markdown b/website/source/docs/commands/agent.html.markdown deleted file mode 100644 index 5c262ad261..0000000000 --- a/website/source/docs/commands/agent.html.markdown +++ /dev/null @@ -1,16 +0,0 @@ ---- -layout: "docs" -page_title: "Commands: Agent" -sidebar_current: "docs-commands-agent" ---- - -# Terraform Agent - -The `terraform agent` command is the heart of Terraform: it runs the agent that -performs the important task of maintaining membership information, -running checks, announcing services, handling queries, etc. - -Due to the power and flexibility of this command, the Terraform agent -is documented in its own section. See the [Terraform Agent](/docs/agent/basics.html) -section for more information on how to use this command and the -options it has. diff --git a/website/source/docs/commands/index.html.markdown b/website/source/docs/commands/index.html.markdown new file mode 100644 index 0000000000..eeacfa5d92 --- /dev/null +++ b/website/source/docs/commands/index.html.markdown @@ -0,0 +1,50 @@ +--- +layout: "docs" +page_title: "Commands" +sidebar_current: "docs-commands" +--- + +# Terraform Commands (CLI) + +Terraform is controlled via a very easy to use command-line interface (CLI). +Terraform is only a single command-line application: terraform. This application +then takes a subcommand such as "apply" or "plan". The complete list of subcommands +is in the navigation to the left. + +The terraform CLI is a well-behaved command line application. In erroneous cases, +a non-zero exit status will be returned. It also responds to -h and --help as you'd +most likely expect. + +To view a list of the available commands at any time, just run terraform with no arguments: + +``` +$ terraform +usage: terraform [--version] [--help] [] + +Available commands are: + apply Builds or changes infrastructure + graph Create a visual graph of Terraform resources + output Read an output from a state file + plan Generate and show an execution plan + refresh Update local state file against real resources + show Inspect Terraform state or plan + version Prints the Terraform version +``` + +To get help for any specific command, pass the -h flag to the relevant subcommand. For example, +to see help about the members subcommand: + +``` +$ terraform graph -h +Usage: terraform graph [options] PATH + + Outputs the visual graph of Terraform resources. If the path given is + the path to a configuration, the dependency graph of the resources are + shown. If the path is a plan file, then the dependency graph of the + plan itself is shown. + + The graph is outputted in DOT format. The typical program that can + read this format is GraphViz, but many web services are also available + to read this format. +``` + diff --git a/website/source/docs/commands/refresh.html.markdown b/website/source/docs/commands/refresh.html.markdown new file mode 100644 index 0000000000..06f42f7fd2 --- /dev/null +++ b/website/source/docs/commands/refresh.html.markdown @@ -0,0 +1,40 @@ +--- +layout: "docs" +page_title: "Command: refresh" +sidebar_current: "docs-commands-refresh" +--- + +# Command: refresh + +The `terraform refresh` command is used to reconcile the state Terraform +knows about (via it's state file) with the real-world infrastructure. +The can be used to detect any drift from the last-known state, and to +update the state file. + +This does not modify infrastructure, but does modify the state file. +If the state is changed, this may cause changes to occur during the next +plan or apply. + +## Usage + +Usage: `terraform refresh [options] [dir]` + +By default, `refresh` requires no flags and looks in the current directory +for the configuration and state file to refresh. + +The command-line flags are all optional. The list of available flags are: + +* `-no-color` - Disables output with coloring + +* `-state=path` - Path to read and write the state file to. Defaults to "terraform.tfstate". + +* `-state-out=path` - Path to write updated state file. By default, the + `-state` path will be used. + +* `-var 'foo=bar'` - Set a variable in the Terraform configuration. This + flag can be set multiple times. + +* `-var-file=foo` - Set variables in the Terraform configuration from + a file. If "terraform.tfvars" is present, it will be automatically + loaded if this flag is not specified. + diff --git a/website/source/docs/commands/show.html.markdown b/website/source/docs/commands/show.html.markdown new file mode 100644 index 0000000000..9888884cb2 --- /dev/null +++ b/website/source/docs/commands/show.html.markdown @@ -0,0 +1,24 @@ +--- +layout: "docs" +page_title: "Command: show" +sidebar_current: "docs-commands-show" +--- + +# Command: show + +The `terraform show` command is used to provide human-readable output +from a state or plan file. This can be used to inspect a plan to ensure +that the planned operations are expected, or to inspect the current state +as terraform sees it. + +## Usage + +Usage: `terraform show [options] ` + +You must call `show` with a path to either a Terraform state file or plan +file. + +The command-line flags are all optional. The list of available flags are: + +* `-no-color` - Disables output with coloring + diff --git a/website/source/layouts/docs.erb b/website/source/layouts/docs.erb index b0a276c2f7..c32287ca1d 100644 --- a/website/source/layouts/docs.erb +++ b/website/source/layouts/docs.erb @@ -15,37 +15,29 @@ > Commands (CLI)