terraform

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2023 License: MPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TF          = ".tf"
	TFVARS      = ".tfvars"
	AUTO_TFVARS = ".auto.tfvars"

	DEFAULT_TFVARS = "terraform.tfvars"
)

Variables

View Source
var VALID_TERRAFORM_FILES = [...]string{TF}
View Source
var VALID_VARIABLE_FILES = [...]string{TF, AUTO_TFVARS}

Functions

func ExtractVariables added in v1.1.0

func ExtractVariables(file File) (ValueMap, ExpressionMap, error)

ExtractVariables extracts the input variables and local values from the provided file

func GenerateDebugLogs added in v0.4.0

func GenerateDebugLogs(err error) string

func ParseHclToJson

func ParseHclToJson(fileName string, fileContent string, variables ModuleVariables) (string, error)

ParseHclToJson parses a provided HCL file to JSON and dereferences any known variables using the provided variables

func ParseModule

func ParseModule(rawFiles map[string]interface{}) map[string]interface{}

ParseModule iterates through all the provided files in a module (.tf, terraform.tfvars, and *.auto.tfvars files) It extracts the variables from each one, merges them, and dereferences them one by one

Types

type CustomError

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

func (*CustomError) Error

func (err *CustomError) Error() string

type ExpressionMap added in v1.1.0

type ExpressionMap map[string]hcl.Expression

type File added in v0.6.0

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

type InputVariablesByFile added in v0.6.0

type InputVariablesByFile map[string]ValueMap

type JSON

type JSON = map[string]interface{}

type ModuleVariables added in v0.6.0

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

type NewParserParams added in v0.6.0

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

type Options

type Options struct {
	Simplify bool
}

type ParseModuleResult added in v0.6.0

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

type Parser

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

type PrioritisableFile added in v0.3.0

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

type ValueMap added in v0.6.0

type ValueMap map[string]cty.Value

Jump to

Keyboard shortcuts

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