tfexec

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package tfexec runs OpenTofu/Terraform commands for Podplane-managed stacks.

Index

Constants

View Source
const CommandEnvVar = "PODPLANE_TF_CMD"

CommandEnvVar selects the OpenTofu or Terraform command used by Podplane.

Variables

This section is empty.

Functions

This section is empty.

Types

type CLI

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

CLI runs OpenTofu/Terraform by invoking a local executable.

func NewCLI

func NewCLI() (*CLI, error)

NewCLI selects the configured executable or finds tofu or terraform on PATH.

func (*CLI) Apply

func (c *CLI) Apply(ctx context.Context, dir string, autoApprove bool) error

Apply runs OpenTofu/Terraform apply in dir.

func (*CLI) Destroy

func (c *CLI) Destroy(ctx context.Context, dir string, autoApprove bool) error

Destroy runs OpenTofu/Terraform destroy in dir.

func (*CLI) Init

func (c *CLI) Init(ctx context.Context, dir string) error

Init runs OpenTofu/Terraform init in dir.

func (*CLI) InitBackendDisabled added in v0.9.0

func (c *CLI) InitBackendDisabled(ctx context.Context, dir string) error

InitBackendDisabled initializes dependencies without configuring a backend.

func (*CLI) OutputJSON

func (c *CLI) OutputJSON(ctx context.Context, dir string) ([]byte, error)

OutputJSON runs OpenTofu/Terraform output -json in dir.

func (*CLI) Platform added in v0.9.0

func (c *CLI) Platform(ctx context.Context) (string, error)

Platform returns the platform reported by the selected engine.

func (*CLI) ProvidersLock added in v0.9.0

func (c *CLI) ProvidersLock(ctx context.Context, dir, mirrorDir string, platforms []string) error

ProvidersLock records provider checksums for platforms from mirrorDir.

func (*CLI) ProvidersMirror added in v0.9.0

func (c *CLI) ProvidersMirror(ctx context.Context, dir, mirrorDir, platform string) error

ProvidersMirror downloads provider packages for platform into mirrorDir.

func (*CLI) WithCLIConfig added in v0.9.0

func (c *CLI) WithCLIConfig(path string) *CLI

WithCLIConfig returns a copy that uses path as TF_CLI_CONFIG_FILE.

type Executor

type Executor interface {
	Init(ctx context.Context, dir string) error
	Apply(ctx context.Context, dir string, autoApprove bool) error
	Destroy(ctx context.Context, dir string, autoApprove bool) error
	OutputJSON(ctx context.Context, dir string) ([]byte, error)
}

Executor runs OpenTofu/Terraform operations for a generated stack.

Jump to

Keyboard shortcuts

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