terraform: return unknown variable value if nil
This commit is contained in:
parent
71918efd96
commit
1429ac6a7f
|
@ -1629,15 +1629,13 @@ func (c *walkContext) computeModuleVariable(
|
||||||
// modules reference other modules, and graph ordering should
|
// modules reference other modules, and graph ordering should
|
||||||
// ensure that the module is in the state, so if we reach this
|
// ensure that the module is in the state, so if we reach this
|
||||||
// point otherwise it really is a panic.
|
// point otherwise it really is a panic.
|
||||||
return "", nil
|
return config.UnknownVariableValue, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
value, ok := mod.Outputs[v.Field]
|
value, ok := mod.Outputs[v.Field]
|
||||||
if !ok {
|
if !ok {
|
||||||
return "", fmt.Errorf(
|
// Same reasons as the comment above.
|
||||||
"Output field '%s' not found for variable '%s'",
|
return config.UnknownVariableValue, nil
|
||||||
v.Field,
|
|
||||||
v.FullKey())
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return value, nil
|
return value, nil
|
||||||
|
|
Loading…
Reference in New Issue