Complete Terraform CLI commands cheat sheet for infrastructure as code. Covers init, plan, apply, state management, workspaces, and import operations.
Search all Terraform shortcuts interactively
Interactive Shortcut Finder| Shortcut | Action | Description |
|---|---|---|
| terraform init | Initialize | Initialize a Terraform working directory. |
| terraform plan | Plan | Preview changes before applying. |
| terraform apply | Apply | Apply infrastructure changes. |
| terraform destroy | Destroy | Destroy all managed resources. |
| terraform fmt | Format | Format Terraform files to standard style. |
| terraform validate | Validate | Validate configuration files. |
| terraform state list | State list | List managed resources. |
| terraform output | Show outputs | Display output variable values. |
The basic workflow is: terraform init (initialize) → terraform plan (preview) → terraform apply (execute) → terraform destroy (cleanup).
terraform plan creates an execution plan showing what changes will be made to your infrastructure without actually applying them.
Use 'terraform import resource_type.name resource_id' to bring existing infrastructure under Terraform management.
Run 'terraform fmt' to automatically format all .tf files to the canonical style.
Browse shortcuts for 230 platforms
Explore All