terraform

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 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

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

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

func GenerateDebugLogs

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

type ExpressionMap map[string]hcl.Expression

type File

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

type InputVariablesByFile

type InputVariablesByFile map[string]ValueMap

type JSON

type JSON = map[string]interface{}

type ModuleVariables

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

type NewParserParams

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

type Options

type Options struct {
	Simplify bool
}

type ParseModuleResult

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

type Parser

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

type PrioritisableFile

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

type ValueMap

type ValueMap map[string]cty.Value

Jump to

Keyboard shortcuts

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