Terraform22 commands
Terraform CLI Cheat Sheet
Essential Terraform commands for infrastructure as code — init, plan, apply, state management, and workspaces.
Core Workflow
| Command | Description |
|---|---|
| Initialize working directory |
| Preview changes |
| Apply changes |
| Apply without prompt |
| Destroy all resources |
| Validate configuration |
| Format config files |
State Management
| Command | Description |
|---|---|
| List resources in state |
| Show resource details |
| Move resource in state |
| Remove resource from state |
| Import existing resource |
| Sync state with real resources |
Workspaces
| Command | Description |
|---|---|
| List workspaces |
| Create workspace |
| Switch workspace |
| Delete workspace |
Output & Debug
| Command | Description |
|---|---|
| Show all outputs |
| Show specific output |
| Interactive console |
| Generate dependency graph |
| Enable debug logging |