LinuxCommandLibrary

tofu

Open-source infrastructure as code tool

TLDR

Initialize directory

$ tofu init
copy
Plan changes
$ tofu plan
copy
Apply changes
$ tofu apply
copy
Destroy resources
$ tofu destroy
copy
Format files
$ tofu fmt
copy
Validate config
$ tofu validate
copy

SYNOPSIS

tofu command [options]

DESCRIPTION

tofu (OpenTofu) is an open-source infrastructure-as-code tool forked from Terraform, allowing you to define cloud and on-premises resources in declarative HCL configuration files. It supports major cloud providers including AWS, GCP, and Azure through a provider plugin system.
The workflow follows an init-plan-apply cycle: init downloads providers and modules, plan previews proposed changes, and apply creates or modifies the actual infrastructure. State is tracked in a state file that maps configuration to real resources, enabling incremental updates and safe destruction with destroy.

PARAMETERS

init

Initialize working directory.
plan
Show execution plan.
apply
Apply changes.
destroy
Remove resources.
fmt
Format files.
validate
Check configuration.
-auto-approve
Skip approval.

CAVEATS

Terraform fork. Provider compatibility. State file important.

HISTORY

OpenTofu was forked from Terraform in 2023 after HashiCorp changed Terraform's license, maintained by the Linux Foundation.

SEE ALSO

terraform(1), pulumi(1), ansible(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community