Terraform. The primary workflow commands

The available commands for execution are listed below.

Main commands:


Prepare your working directory for other commands

terraform init


Check whether the configuration is valid

terraform validate

Show changes required by the current configuration

terraform plan 

Create or update infrastructure

terraform apply

Destroy previously-created infrastructure

terraform destroy 

All other commands:


Try Terraform expressions at an interactive command prompt

terraform console 


Reformat your configuration in the standard style

terraform fmt 


Release a stuck lock on the current workspace

terraform force-unlock 


Install or upgrade remote Terraform modules

terraform get


Generate a Graphviz graph of the steps in an operation

terraform graph 


Associate existing infrastructure with a Terraform resource

terraform import 


Obtain and save credentials for a remote host

terraform login 


Remove locally-stored credentials for a remote host

terraform logout 


Show output values from your root module

terraform output 


Show the providers required for this configuration

terraform providers 


Update the state to match remote systems

terraform refresh 


Show the current state or a saved plan

terraform show 


Advanced state management

terraform state 


Mark a resource instance as not fully functional

terraform taint 


Experimental support for module integration testing

terraform test 


Remove the ‘tainted’ state from a resource instance

terraform untaint 


Show the current Terraform version

terraform version 


Workspace management

terraform workspace