run

package
v0.19.913 Latest Latest
Warning

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

Go to latest
Published: May 1, 2026 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(v *validator.Validate, opts ...runOption) (*run, error)

func WithLogger

func WithLogger(l hclog.Logger) runOption

func WithOutputSettings

func WithOutputSettings(settings *OutputSettings) runOption

func WithPrePlanHook added in v0.19.894

func WithPrePlanHook(h PrePlanHook) runOption

WithPrePlanHook registers a callback that runs after init and before plan. Intended for deterministic state migrations (e.g. `terraform state mv`) that must happen before the planner evaluates `for_each` keys.

func WithWorkspace

func WithWorkspace(w workspace.Workspace) runOption

Types

type OutputSettings

type OutputSettings struct {
	Ignore         bool
	Credentials    *credentials.Config `validate:"required_unless=Ignore true"`
	Bucket         string              `validate:"required_unless=Ignore true"`
	JobPrefix      string              `validate:"required_unless=Ignore true"`
	InstancePrefix string              `validate:"required_unless=Ignore true"`
}

type PrePlanHook added in v0.19.894

type PrePlanHook func(ctx context.Context, log hclog.Logger, w workspace.Workspace) error

PrePlanHook runs after `terraform init` and before `terraform plan`. Use it to mutate state (e.g. `terraform state mv`) in a controlled way before the planner evaluates `for_each` keys.

type Run

type Run interface {
	Apply(context.Context) error
	ApplyPlan(context.Context) error
	Validate(context.Context) error
	Plan(context.Context) error
	Destroy(context.Context) error
	DestroyPlan(context.Context) error
}

Run accepts a workspace, and executes the provided command in it, uploading outputs to the correct place, afterwards.

Jump to

Keyboard shortcuts

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