@zuke/tofu

← API reference

`@zuke/tofu` — typed `TofuTasks` wrappers for the OpenTofu CLI (`tofu`), for

Symbols

# TofuApplySettings class
class TofuApplySettings extends TofuSettings

Settings for tofu apply.

MemberSignatureDoc
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).
# TofuDestroySettings class
class TofuDestroySettings extends TofuSettings

Settings for tofu destroy.

MemberSignatureDoc
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.
# TofuFmtSettings class
class TofuFmtSettings extends TofuSettings

Settings for tofu fmt.

MemberSignatureDoc
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).
# TofuInitSettings class
class TofuInitSettings extends TofuSettings

Settings for tofu init.

MemberSignatureDoc
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).
# TofuOutputSettings class
class TofuOutputSettings extends TofuSettings

Settings for tofu output.

MemberSignatureDoc
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).
# TofuPlanSettings class
class TofuPlanSettings extends TofuSettings

Settings for tofu plan.

MemberSignatureDoc
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).
# TofuSettings class
class TofuSettings extends ToolSettings

Base for all tofu subcommand settings: binary is tofu.

# TofuTasks const
const TofuTasks: TofuTasksApi

Typed task functions for the tofu CLI.

# TofuTasksApi interface
interface TofuTasksApi

The shape of TofuTasks.

MemberSignatureDoc
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.
# TofuValidateSettings class
class TofuValidateSettings extends TofuSettings

Settings for tofu validate.

MemberSignatureDoc
json json(): this Emit machine-readable JSON output (-json).