Terraform
Define and provision cloud infrastructure as code. Plan, apply, and manage resources across any cloud provider.
70 commands
Browse by Topic
Getting Started
Quick setup and installation
State
State management
Workspace
Workspace operations
Providers
Provider management
Modules
Module operations
Testing
Terraform 1.6+ test framework
Backends
Cloud backend configuration
Security
State encryption & security
Install Terraform (macOS)
Install Terraform using Homebrew on macOS
Install Terraform (Windows)
Install Terraform using Chocolatey on Windows
Verify installation
Check Terraform version to verify installation
Initialize Terraform project
Initialize a working directory containing Terraform configuration files
List workspaces
Show all workspaces.
Show current
Display current workspace name.
Create workspace
Create and switch to new workspace.
Select workspace
Switch to existing workspace.
Delete workspace
Delete an empty workspace.
Use in config
Reference workspace name in configuration.
Plan changes
Preview changes without applying.
Plan to file
Save plan to file for later apply.
Plan destroy
Preview destruction of resources.
Apply changes
Apply changes with approval prompt.
Apply auto-approve
Apply without confirmation (CI/CD).
Apply saved plan
Apply a previously saved plan.
Target specific resource
Apply only to specific resource.
Destroy all
Destroy all managed infrastructure.
Destroy auto-approve
Destroy without confirmation.
Validate config
Check configuration syntax and consistency.
Lock providers
Generate dependency lock file for platforms.
Show providers
Show required providers tree.
Taint resource
Mark resource for recreation on next apply.
Untaint resource
Remove taint from resource.
Replace resource
Force recreation of resource (replaces taint).
Format files
Format .tf files in current directory.
Format recursive
Format all .tf files recursively.
Check formatting
Check if files are formatted (CI/CD).
Show outputs
Display all output values.
Get output JSON
Output values as JSON.
Get specific output
Get single output without quotes.
Show current state
Display current state or saved plan.
Show as JSON
Output state as JSON.
Generate graph
Create dependency graph image.
Interactive console
Open interactive expression console.
Get modules
Download and update modules.
Pass variables
Pass variable on command line.
Use var file
Load variables from file.
Version
Show Terraform and provider versions.
Run tests
Run Terraform tests (requires Terraform 1.6+).
Verbose test output
Run tests with detailed verbose output.
Run specific test
Run a specific test by name or pattern.
Test with variables
Run tests with custom variable values.
Test JSON output
Output test results in JSON format for CI/CD.
Configure S3 backend
Initialize with S3 backend bucket configuration.
Migrate state to backend
Migrate existing state to newly configured backend.
Reconfigure backend
Reconfigure backend, ignoring existing configuration.
Push state manually
Manually upload local state file to remote backend.
Pull remote state
Download remote state to local file.
Enable state encryption
Initialize backend with encryption enabled (S3).
Replace provider
Replace provider reference in state (e.g., after fork).
Force unlock state
Force unlock stuck state (use with extreme caution).
Refresh without lock
Refresh state without acquiring state lock.
Custom lock timeout
Set custom timeout for state lock acquisition.
Discussion
Loading comments...