executor

package
v2.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package executor executes Terraform

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExecutionOutput

type ExecutionOutput struct {
	StdOut string
	StdErr string
}

ExecutionOutput captures output from tf cli execution

type ExecutorBuilder

type ExecutorBuilder interface {
	VersionedExecutor(tfVersion *version.Version) TerraformExecutor
}

func NewExecutorFactory

func NewExecutorFactory(dir string, params map[string]string, envVars map[string]string) ExecutorBuilder

type ExecutorFactory

type ExecutorFactory struct {
	Dir              string
	DefaultTfVersion *version.Version
	Params           map[string]string
	EnvVars          map[string]string
}

func (ExecutorFactory) VersionedExecutor

func (executorFactory ExecutorFactory) VersionedExecutor(tfVersion *version.Version) TerraformExecutor

type TFBinariesContext

type TFBinariesContext struct {
	Dir              string
	DefaultTfVersion *version.Version
	Params           map[string]string

	TfUpgradePath        []*version.Version
	ProviderReplacements map[string]string
}

TFBinariesContext is used to hold information about the location of terraform binaries on disk along with some metadata about how to run them.

type TerraformExecutor

type TerraformExecutor interface {
	Execute(context.Context, *exec.Cmd) (ExecutionOutput, error)
}

TerraformExecutor is the function that shells out to Terraform. It can intercept, modify or retry the given command.

func CustomEnvironmentExecutor

func CustomEnvironmentExecutor(environment map[string]string, wrapped TerraformExecutor) TerraformExecutor

CustomEnvironmentExecutor sets custom environment variables on the Terraform execution.

func CustomTerraformExecutor

func CustomTerraformExecutor(tfBinaryPath, tfPluginDir string, tfVersion *version.Version, wrapped TerraformExecutor) TerraformExecutor

CustomTerraformExecutor executes a custom Terraform binary that uses plugins from a given plugin directory rather than the Terraform that's on the PATH which will download provider binaries from the web.

func DefaultExecutor

func DefaultExecutor() TerraformExecutor

DefaultExecutor is the default executor that shells out to Terraform and logs results to stdout.

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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