terraform

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package terraform initializes an engine that execute terraform commands and generate terraform code. It only deals with interfaces describing what terraform should do, and not the specific implementation. Each version of terraform should have its own implementation, or reuse older one if no changes are made to file format.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Version

func Version() string

Version checks the current terraform version, returns empty string if not found

Types

type Engine

type Engine struct {
	Version string

	Compatibility def.VersionCompatibility
	Generator     def.Generator
	Executor      def.Executor
}

Engine that can process version specific terraform commands

func NewEngine

func NewEngine(options *def.Options) *Engine

NewEngine creates a terraform engine for the currently installed terraform version

func (*Engine) CreateOverrides

func (e *Engine) CreateOverrides(file *loader.ParsedFile) error

CreateOverrides create the tau_override file in module folder. This file will overide backend settings

func (*Engine) ResolveDependencies

func (e *Engine) ResolveDependencies(file *loader.ParsedFile) (bool, error)

ResolveDependencies processes the source file and generates terraform modules for each unique source. For each source it will generate output arguments and return the merged values

Bool return value indicates if it successfully resolved the dependency and should proceed to create source. If it failed to resolve dependencies but error is nil, it should not proceed to create this source, but should also not fail application. That generally means that it was a problem resolving dependencies for this source only. Other sources can still be generated.

func (*Engine) WriteInputVariables

func (e *Engine) WriteInputVariables(file *loader.ParsedFile) error

WriteInputVariables write the terraform.tfvars file into module folder. This file is the parsed and processed variables where all dependencies and data source have been resolved and replaced with real values

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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