func getVarInfo()

in mpdev/internal/tf/overwrite.go [128:140]


func getVarInfo(varname string, dir string) (*tfconfig.Variable, error) {
	module, diag := tfconfig.LoadModule(dir)
	if diag.HasErrors() {
		return nil, fmt.Errorf("failure parsing terraform module: %w", diag)
	}

	variable, ok := module.Variables[varname]
	if !ok {
		return nil, fmt.Errorf("variable: %s not found in module", varname)
	}

	return variable, nil
}