Documentation
¶
Overview ¶
(C) Copyright 2024 Hewlett Packard Enterprise Development LP
(C) Copyright 2024 Hewlett Packard Enterprise Development LP
(C) Copyright 2024 Hewlett Packard Enterprise Development LP
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrFilesNotFound = fmt.Errorf("no .tf files found") ErrNoVariablesFound = fmt.Errorf("tf files don't contain any variables") )
Functions ¶
func ExpressionToJSONObject ¶
ExpressionToJSONObject converts an HCL expression to an `any` type so that can be marshaled to JSON later.
func GetTypeConstraint ¶
GetTypeConstraint converts the expression into a type constraint and marshals it to JSON. Returns the JSON output as a []byte. More info on exactly how this works is here: https://pkg.go.dev/github.com/zclconf/go-cty@v1.14.4/cty#Type.MarshalJSON
func GetVarMap ¶
GetVarMap reads all .tf files in a directory and returns a map of variable names to their translated values. For the purpose of this application, all that matters is the model.VariableBlock contained in this, which contains a direct unmarshal of the block itself using the hcl package. The rest of the information is for debugging purposes, and to simplify the process of deciding if a variable is 'required' later. Note: in 'strict' mode, all variables are required, regardless of whether they have a default value or not.
Types ¶
This section is empty.