terraform

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: MPL-2.0 Imports: 18 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseModuleResolver

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

BaseModuleResolver holds the shared dependencies and the tfvars logic of the module resolvers.

func NewBaseModuleResolver

func NewBaseModuleResolver(rt *runtime.Runtime, blueprintHandler blueprint.BlueprintHandler) *BaseModuleResolver

NewBaseModuleResolver creates a base module resolver from the runtime and the blueprint handler. It panics if rt, blueprintHandler, or rt.Evaluator is nil.

func (*BaseModuleResolver) GenerateTfvars

func (h *BaseModuleResolver) GenerateTfvars(overwrite bool) error

GenerateTfvars writes a terraform.tfvars file for each terraform component in the blueprint. It evaluates the component inputs against the current configuration. It does not write an input whose value still contains a deferred expression. It always replaces the old tfvars files, so the overwrite argument has no effect. It stops at the first evaluation or file error.

type CompositeModuleResolver

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

CompositeModuleResolver handles terraform modules through the OCI and standard resolvers.

func NewCompositeModuleResolver

func NewCompositeModuleResolver(rt *runtime.Runtime, blueprintHandler blueprint.BlueprintHandler, artifactBuilder artifact.Artifact) *CompositeModuleResolver

NewCompositeModuleResolver creates a composite module resolver with an OCI resolver and a standard resolver. It panics if rt, blueprintHandler, or artifactBuilder is nil.

func (*CompositeModuleResolver) GenerateTfvars

func (h *CompositeModuleResolver) GenerateTfvars(overwrite bool) error

GenerateTfvars writes the tfvars files for all terraform components through the standard resolver. All resolvers share the same BaseModuleResolver implementation.

func (*CompositeModuleResolver) ProcessModules

func (h *CompositeModuleResolver) ProcessModules() error

ProcessModules runs ProcessModules on the OCI resolver, then on the standard resolver. It stops at the first error.

type MockModuleResolver

type MockModuleResolver struct {
	ProcessModulesFunc func() error
	GenerateTfvarsFunc func(overwrite bool) error
}

MockModuleResolver is a mock implementation of the ModuleResolver interface.

func NewMockModuleResolver

func NewMockModuleResolver() *MockModuleResolver

NewMockModuleResolver creates a new MockModuleResolver instance

func (*MockModuleResolver) GenerateTfvars

func (m *MockModuleResolver) GenerateTfvars(overwrite bool) error

GenerateTfvars calls the mock GenerateTfvarsFunc if set, otherwise returns nil

func (*MockModuleResolver) ProcessModules

func (m *MockModuleResolver) ProcessModules() error

ProcessModules calls the mock ProcessModulesFunc if set, otherwise returns nil

type ModuleResolver

type ModuleResolver interface {
	ProcessModules() error
	GenerateTfvars(overwrite bool) error
}

ModuleResolver writes the shim modules and the tfvars files of the terraform components.

type OCIModuleResolver

type OCIModuleResolver struct {
	*BaseModuleResolver
	// contains filtered or unexported fields
}

OCIModuleResolver handles terraform modules from OCI artifacts.

func NewOCIModuleResolver

func NewOCIModuleResolver(rt *runtime.Runtime, blueprintHandler blueprint.BlueprintHandler, artifactBuilder artifact.Artifact) *OCIModuleResolver

NewOCIModuleResolver creates an OCI module resolver from the runtime, the blueprint handler, and the artifact builder. It panics if rt, blueprintHandler, or artifactBuilder is nil.

func (*OCIModuleResolver) ProcessModules

func (h *OCIModuleResolver) ProcessModules() error

ProcessModules pulls the OCI artifacts that the terraform components use and writes a shim for each OCI component. It pulls each artifact once, and stops at the first pull or component error.

type Shims

type Shims struct {
	shims.Shims
	Chdir       func(dir string) error
	FilepathRel func(basepath, targpath string) (string, error)
}

Shims holds the shared system call primitives and the terraform-specific shims.

func NewShims

func NewShims() *Shims

NewShims returns a Shims with every field set to its real implementation.

type StandardModuleResolver

type StandardModuleResolver struct {
	*BaseModuleResolver
}

StandardModuleResolver handles standard terraform module sources, such as git and local paths.

func NewStandardModuleResolver

func NewStandardModuleResolver(rt *runtime.Runtime, blueprintHandler blueprint.BlueprintHandler) *StandardModuleResolver

NewStandardModuleResolver creates a standard module resolver from the runtime and the blueprint handler. It panics if rt or blueprintHandler is nil.

func (*StandardModuleResolver) ProcessModules

func (h *StandardModuleResolver) ProcessModules() error

ProcessModules writes a shim for each terraform component that this resolver handles. A local component with a name gets a shim that points to terraform/<path>. A template source gets a shim that points to the template module. A remote source gets a shim that terraform init resolves. It runs the terraform check once. It stops at the first error.

type TerraformInitOutput

type TerraformInitOutput struct {
	Type    string `json:"@type"`
	Message string `json:"@message"`
}

TerraformInitOutput is one JSON line of the terraform init output.

type VariableInfo

type VariableInfo struct {
	Name        string
	Description string
	Default     any
	Sensitive   bool
}

VariableInfo holds the metadata of one terraform variable.

Jump to

Keyboard shortcuts

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