@zuke/tofu
`@zuke/tofu` — typed `TofuTasks` wrappers for the OpenTofu CLI (`tofu`), for
@zuke/tofu on JSR ↗ 10 symbols
Symbols
class TofuApplySettings extends TofuSettings Settings for tofu apply.
| Member | Signature | Doc |
|---|---|---|
autoApprove | autoApprove(): this | Apply without an interactive approval prompt (-auto-approve). |
var | var(name: string, value: string): this | Set an input variable (-var=name=value); repeatable. |
varFile | varFile(path: string): this | Load variables from a file (-var-file=); repeatable. |
noInput | noInput(): this | Do not prompt for input (-input=false). |
planFile | planFile(path: string): this | Apply a previously saved plan file (positional argument). |
class TofuDestroySettings extends TofuSettings Settings for tofu destroy.
| Member | Signature | Doc |
|---|---|---|
autoApprove | autoApprove(): this | Destroy without an interactive approval prompt (-auto-approve). |
var | var(name: string, value: string): this | Set an input variable (-var=name=value); repeatable. |
varFile | varFile(path: string): this | Load variables from a file (-var-file=); repeatable. |
class TofuFmtSettings extends TofuSettings Settings for tofu fmt.
| Member | Signature | Doc |
|---|---|---|
check | check(): this | Check formatting without writing changes (-check). |
recursive | recursive(): this | Also process nested directories (-recursive). |
diff | diff(): this | Show a diff of formatting changes (-diff). |
class TofuInitSettings extends TofuSettings Settings for tofu init.
| Member | Signature | Doc |
|---|---|---|
upgrade | upgrade(): this | Upgrade modules and plugins to the latest versions (-upgrade). |
reconfigure | reconfigure(): this | Reconfigure the backend, ignoring saved config (-reconfigure). |
noBackend | noBackend(): this | Disable backend initialization (-backend=false). |
noInput | noInput(): this | Do not prompt for input (-input=false). |
class TofuOutputSettings extends TofuSettings Settings for tofu output.
| Member | Signature | Doc |
|---|---|---|
json | json(): this | Emit machine-readable JSON output (-json). |
raw | raw(): this | Emit a single value with no quotes (-raw); requires a name. |
name | name(value: string): this | Read a single named output (positional argument). |
class TofuPlanSettings extends TofuSettings Settings for tofu plan.
| Member | Signature | Doc |
|---|---|---|
out | out(path: string): this | Write the plan to a file (-out=). |
var | var(name: string, value: string): this | Set an input variable (-var=name=value); repeatable. |
varFile | varFile(path: string): this | Load variables from a file (-var-file=); repeatable. |
destroy | destroy(): this | Plan a destroy run (-destroy). |
noInput | noInput(): this | Do not prompt for input (-input=false). |
class TofuSettings extends ToolSettings Base for all tofu subcommand settings: binary is tofu.
const TofuTasks: TofuTasksApi Typed task functions for the tofu CLI.
interface TofuTasksApi The shape of TofuTasks.
| Member | Signature | Doc |
|---|---|---|
init | init(configure?: Configure<TofuInitSettings>): Promise<CommandOutput> | Initialize a working directory: tofu init. |
validate | validate(configure?: Configure<TofuValidateSettings>): Promise<CommandOutput> | Validate the configuration: tofu validate. |
plan | plan(configure?: Configure<TofuPlanSettings>): Promise<CommandOutput> | Create an execution plan: tofu plan. |
apply | apply(configure?: Configure<TofuApplySettings>): Promise<CommandOutput> | Apply the changes: tofu apply. |
destroy | destroy(configure?: Configure<TofuDestroySettings>): Promise<CommandOutput> | Destroy managed infrastructure: tofu destroy. |
fmt | fmt(configure?: Configure<TofuFmtSettings>): Promise<CommandOutput> | Format configuration files: tofu fmt. |
output | output(configure?: Configure<TofuOutputSettings>): Promise<CommandOutput> | Read output values: tofu output. |
class TofuValidateSettings extends TofuSettings Settings for tofu validate.
| Member | Signature | Doc |
|---|---|---|
json | json(): this | Emit machine-readable JSON output (-json). |