OpenTofu
Open-source Terraform alternative for infrastructure as code. Community-driven, backward-compatible, and truly open.
58 commands
Browse by Topic
Getting Started
Quick setup and installation
Initialization
Initialize config
Planning
Preview changes
Applying
Apply changes
State
State management
Encryption
State encryption
Workspaces
Workspace management
Output & Utils
Output, format, validate
Install OpenTofu (macOS)
Install OpenTofu using Homebrew on macOS
Check OpenTofu version
Display the installed OpenTofu version
Initialize a new project
Initialize a new OpenTofu working directory with providers
Initialize
Initialize OpenTofu configuration.
Upgrade providers
Upgrade providers and modules.
Reconfigure backend
Reconfigure backend settings.
Migrate state
Migrate state to new backend.
Backend config file
Initialize with external backend config file.
Backend config variable
Pass individual backend config key-value pair.
Plugin cache directory
Use local plugin cache to speed up init.
Lock provider versions
Generate lock file for multiple platforms.
Create plan
Show planned changes.
Save plan
Save plan to file.
Plan with variables
Plan with variable override.
Destroy plan
Plan resource destruction.
Plan with var file
Plan using a variables file.
Target specific resource
Plan changes for a specific resource only.
Replace resource
Plan to force-replace a specific resource.
Refresh-only plan
Plan to update state without changing resources.
Generate import config
Generate config for imported resources.
Apply changes
Apply infrastructure changes.
Apply saved plan
Apply from saved plan file.
Auto-approve
Apply without confirmation.
Destroy resources
Destroy all resources.
Target specific resource
Apply to specific resource.
Set parallelism
Apply with custom parallelism limit.
Replace resource
Force-replace a specific resource.
Refresh-only apply
Update state to match real resources.
Destroy auto-approve
Destroy all resources without confirmation.
List state
List resources in state.
Show resource
Show resource details.
Move resource
Rename resource in state.
Import resource
Import existing resource.
Remove from state
Remove resource from state.
Pull remote state
Download and output remote state.
Push state
Upload a local state file to remote backend.
Force unlock state
Manually unlock a stuck state lock.
Replace provider
Replace provider source in state.
Enable encryption
Configure state encryption.
AWS KMS encryption
Use AWS KMS for encryption.
GCP KMS encryption
Use Google Cloud KMS for state encryption.
Plan file encryption
Encrypt plan files alongside state.
List workspaces
List all available workspaces.
Create workspace
Create a new workspace.
Select workspace
Switch to an existing workspace.
Show current workspace
Display the current workspace name.
Delete workspace
Delete an existing workspace.
List all outputs
Show all output values from state.
Get specific output
Show a single output value.
Output as JSON
Show all outputs in JSON format.
Raw output value
Show raw value without quotes or formatting.
Format files
Format all .tf files in current directory.
Format recursively
Format .tf files in all subdirectories.
Check formatting
Check if files are formatted without modifying.
Validate config
Validate configuration syntax and consistency.
Dependency graph
Generate visual dependency graph.
List providers
Show providers required by configuration.
Show version
Display OpenTofu and provider versions.
Discussion
Loading comments...