Documentation ¶
Index ¶
- Constants
- func CheckInputVariables(defs map[string]*modconfig.Variable, values terraform.InputValues) tfdiags.Diagnostics
- func CollectVariableValues(workspacePath string, variableFileArgs []string, variablesArgs []string, ...) (map[string]UnparsedVariableValue, error)
- func CollectVariableValuesFromModRequire(m *modconfig.Mod, lock *versionmap.WorkspaceLock) (terraform.InputValues, error)
- func ParseVariableValues(inputValueUnparsed map[string]UnparsedVariableValue, ...) (terraform.InputValues, tfdiags.Diagnostics)
- func SetVariableValues(vv terraform.InputValues, m *modconfig.ModVariableMap)
- func SourceTypeString(v *terraform.InputValue) string
- type UIInput
- type UnparsedInteractiveVariableValue
- type UnparsedVariableValue
Constants ¶
const ValueFromModFile terraform.ValueSourceType = 'M'
Variables ¶
This section is empty.
Functions ¶
func CheckInputVariables ¶
func CheckInputVariables(defs map[string]*modconfig.Variable, values terraform.InputValues) tfdiags.Diagnostics
CheckInputVariables ensures that variable values supplied at the UI conform to their corresponding declarations in configuration.
The set of values is considered valid only if the returned diagnostics does not contain errors. A valid set of values may still produce warnings, which should be returned to the user.
func CollectVariableValues ¶
func CollectVariableValues(workspacePath string, variableFileArgs []string, variablesArgs []string, workspaceModName string) (map[string]UnparsedVariableValue, error)
CollectVariableValues inspects the various places that configuration input variable values can come from and constructs a map ready to be passed to the backend as part of a Operation.
This method returns diagnostics relating to the collection of the values, but the values themselves may produce additional diagnostics when finally parsed.
func CollectVariableValuesFromModRequire ¶
func CollectVariableValuesFromModRequire(m *modconfig.Mod, lock *versionmap.WorkspaceLock) (terraform.InputValues, error)
func ParseVariableValues ¶
func ParseVariableValues(inputValueUnparsed map[string]UnparsedVariableValue, requireArgs terraform.InputValues, variablesMap *modconfig.ModVariableMap, validate bool) (terraform.InputValues, tfdiags.Diagnostics)
ParseVariableValues processes a map of unparsed variable values by correlating each one with the given variable declarations which should be from a configuration.
It also takes into account parsed values which are declares in the mod require block ¶
The map of unparsed variable values should include variables from all possible configuration declarations sources such that it is as complete as it can possibly be for the current operation. If any declared variables are not included in the map, ParseVariableValues will either substitute a configured default value or produce an error.
func SetVariableValues ¶
func SetVariableValues(vv terraform.InputValues, m *modconfig.ModVariableMap)
SetVariableValues determines whether the given variable is a public variable and if so sets its value
func SourceTypeString ¶
func SourceTypeString(v *terraform.InputValue) string
Types ¶
type UIInput ¶
type UIInput struct { // Colorize will color the output. Colorize *colorstring.Colorize // Reader and Writer for IO. If these aren't set, they will default to // Stdin and Stdout respectively. Reader io.Reader Writer io.Writer // contains filtered or unexported fields }
UIInput is an implementation of terraform.UIInput that asks the CLI for input stdin.
type UnparsedInteractiveVariableValue ¶
type UnparsedInteractiveVariableValue struct {
Name, RawValue string
}
func (UnparsedInteractiveVariableValue) ParseVariableValue ¶
func (v UnparsedInteractiveVariableValue) ParseVariableValue(mode var_config.VariableParsingMode) (*terraform.InputValue, tfdiags.Diagnostics)
type UnparsedVariableValue ¶
type UnparsedVariableValue interface { // ParseVariableValue information in the provided variable configuration // to parse (if necessary) and return the variable value encapsulated in // the receiver. // // If error diagnostics are returned, the resulting value may be invalid // or incomplete. ParseVariableValue(mode var_config.VariableParsingMode) (*terraform.InputValue, tfdiags.Diagnostics) }
UnparsedVariableValue represents a variable value provided by the caller whose parsing must be deferred until configuration is available.
This exists to allow processing of variable-setting arguments (e.g. in the command package) to be separated from parsing (in the backend package).