Help us shape the future of Go! Take the 2026 Go Developer Survey

terraform

package
v1.36.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 15, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cli

type Cli struct {
	// contains filtered or unexported fields
}

func NewCli

func NewCli(commandRunner exec.CommandRunner) *Cli

func (*Cli) Apply

func (cli *Cli) Apply(ctx context.Context, modulePath string, additionalArgs ...string) (string, error)

func (*Cli) CheckInstalled

func (cli *Cli) CheckInstalled(ctx context.Context) error

func (*Cli) Destroy

func (cli *Cli) Destroy(ctx context.Context, modulePath string, additionalArgs ...string) (string, error)

func (*Cli) Init

func (cli *Cli) Init(ctx context.Context, modulePath string, additionalArgs ...string) (string, error)

Init runs `terraform init`. Callers control whether providers/modules are upgraded by passing `-upgrade` (the provisioning path does); destroy paths omit it so teardown does not unexpectedly select newer providers or rewrite `.terraform.lock.hcl`.

func (*Cli) InstallUrl

func (cli *Cli) InstallUrl() string

Doc to be added for terraform install

func (*Cli) Name

func (cli *Cli) Name() string

func (*Cli) Output

func (cli *Cli) Output(ctx context.Context, modulePath string, additionalArgs ...string) (string, error)

func (*Cli) Plan

func (cli *Cli) Plan(
	ctx context.Context,
	modulePath string,
	planFilePath string,
	additionalArgs ...string,
) (string, error)

func (*Cli) PlanDestroy added in v1.28.1

func (cli *Cli) PlanDestroy(ctx context.Context, modulePath string, additionalArgs ...string) (string, error)

PlanDestroy runs `terraform plan -destroy` to preview the resources that would be destroyed, without deleting anything. Output is streamed to the console. -input=false ensures terraform never blocks on stdin, which makes it safe to run in non-interactive/CI environments.

func (*Cli) SetEnv

func (cli *Cli) SetEnv(env []string)

Set environment variables to be used in all terraform commands

func (*Cli) Show

func (cli *Cli) Show(ctx context.Context, modulePath string, additionalArgs ...string) (string, error)

func (*Cli) Validate

func (cli *Cli) Validate(ctx context.Context, modulePath string) (string, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL