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

58 lines
2.3 KiB
Markdown
Raw Normal View History

2014-07-24 18:02:10 +02:00
---
layout: "docs"
page_title: "Commands"
sidebar_current: "docs-commands"
2014-10-22 05:21:56 +02:00
description: |-
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.
2014-07-24 18:02:10 +02:00
---
# 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] <command> [<args>]
Available commands are:
apply Builds or changes infrastructure
2014-12-06 00:19:26 +01:00
destroy Destroy Terraform-managed infrastructure
get Download and install modules for the configuration
2014-07-24 18:02:10 +02:00
graph Create a visual graph of Terraform resources
2014-12-06 00:19:26 +01:00
init Initializes Terraform configuration from a module
2014-07-24 18:02:10 +02:00
output Read an output from a state file
plan Generate and show an execution plan
refresh Update local state file against real resources
2015-03-05 01:35:42 +01:00
remote Configure remote state storage
2014-07-24 18:02:10 +02:00
show Inspect Terraform state or plan
2015-03-05 01:35:42 +01:00
taint Manually mark a resource for recreation
2015-11-05 15:47:08 +01:00
validate Validates the Terraform files
2014-07-24 18:02:10 +02:00
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.
```