engine

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: May 22, 2026 License: MIT Imports: 35 Imported by: 0

Documentation

Overview

Package engine provides the pluggable IaC engine for Terragrunt.

Index

Constants

View Source
const PublicKey = `` /* 2431-byte string literal not displayed */

Variables

View Source
var ErrEngineInitFailed = errors.New("engine init failed")
View Source
var ErrEngineShutdownFailed = errors.New("engine shutdown failed")

Functions

func ConvertMetaToProtobuf

func ConvertMetaToProtobuf(meta map[string]any) (map[string]*anypb.Any, error)

ConvertMetaToProtobuf converts metadata map to protobuf map

func ReadEngineOutput

func ReadEngineOutput(runOptions *ExecutionOptions, forceStdErr bool, output outputFn) error

ReadEngineOutput reads the output from the engine, since grpc plugins don't have common type, use lambda function to read bytes from the stream

func Run

func Run(
	ctx context.Context,
	l log.Logger,
	e vexec.Exec,
	execOptions *ExecutionOptions,
) (*util.CmdOutput, error)

Run executes the given command with the experimental engine. The provided vexec.Exec is used to spawn the engine plugin subprocess and must be OS-backed.

func Shutdown

func Shutdown(ctx context.Context, l log.Logger, experiments experiment.Experiments, noEngine bool) error

Shutdown shuts down the experimental engine.

func WithEngineValues

func WithEngineValues(ctx context.Context) context.Context

WithEngineValues add to context default values for engine.

Types

type EngineConfig added in v1.0.0

type EngineConfig struct {
	Meta    map[string]any
	Source  string
	Version string
	Type    string
}

EngineConfig represents the configurations for a Terragrunt engine.

type EngineOptions added in v1.0.0

type EngineOptions struct {
	// CachePath is the path to the cache directory for engine files.
	CachePath string
	// LogLevel is the custom log level for engine.
	LogLevel string
	// SkipChecksumCheck skips checksum verification for engine packages.
	SkipChecksumCheck bool
	// NoEngine disables IaC engines even when the iac-engine experiment is enabled.
	NoEngine bool
}

EngineOptions groups CLI-supplied engine options.

type ExecutionOptions

type ExecutionOptions struct {
	Writers           writer.Writers
	EngineOptions     *EngineOptions
	EngineConfig      *EngineConfig
	Env               map[string]string
	WorkingDir        string
	RootWorkingDir    string
	Command           string
	Args              []string
	Headless          bool
	ForwardTFStdout   bool
	SuppressStdout    bool
	AllocatePseudoTty bool
}

type OutputLine

type OutputLine struct {
	Stdout string
	Stderr string
}

OutputLine represents the output from the engine

Jump to

Keyboard shortcuts

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