Linux command
tofu-plan 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Create execution plan
tofu plan
Save plan to file
tofu plan -out=[plan.tfplan]
Plan with variable
tofu plan -var="[key]=[value]"
Plan destroy
tofu plan -destroy
说明
tofu plan creates an execution plan for OpenTofu. OpenTofu is the open-source fork of Terraform. Shows proposed changes before applying to infrastructure.
参数
- -out _file_
- Save plan to file.
- -var _name=value_
- Set variable.
- -var-file _file_
- Variable file.
- -target _resource_
- Target specific resource.
- -destroy
- Plan destruction.
- -refresh-only
- Update state without proposing changes.
- -refresh=false
- Skip syncing state with remote objects.
- -parallelism _n_
- Limit concurrent operations (default: 10).
- -detailed-exitcode
- Return 0 (no changes), 1 (error), or 2 (changes present).
- -input=false
- Disable prompts for unset variables.
- -json
- Machine-readable JSON output.
FAQ
What is the tofu-plan command used for?
tofu plan creates an execution plan for OpenTofu. OpenTofu is the open-source fork of Terraform. Shows proposed changes before applying to infrastructure.
How do I run a basic tofu-plan example?
Run `tofu plan` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -out _file_ do in tofu-plan?
Save plan to file.