terraform: module input to another module doesn't error [GH-659]
This commit is contained in:
parent
e1201f079a
commit
e5f07567c6
|
@ -20,6 +20,8 @@ BUG FIXES:
|
||||||
diffing lists. [GH-661]
|
diffing lists. [GH-661]
|
||||||
* core: fix crash where module inputs weren't strings, and add more
|
* core: fix crash where module inputs weren't strings, and add more
|
||||||
validation around invalid types here. [GH-624]
|
validation around invalid types here. [GH-624]
|
||||||
|
* core: fix error when using a computed module output as an input to
|
||||||
|
another module. [GH-659]
|
||||||
* provider/aws: Fix crash case when internet gateway is not attached
|
* provider/aws: Fix crash case when internet gateway is not attached
|
||||||
to any VPC. [GH-664]
|
to any VPC. [GH-664]
|
||||||
* provider/aws: `vpc_id` is no longer required. [GH-667]
|
* provider/aws: `vpc_id` is no longer required. [GH-667]
|
||||||
|
|
|
@ -1623,10 +1623,7 @@ func (c *walkContext) computeModuleVariable(
|
||||||
// Get that module from our state
|
// Get that module from our state
|
||||||
mod := c.Context.state.ModuleByPath(path)
|
mod := c.Context.state.ModuleByPath(path)
|
||||||
if mod == nil {
|
if mod == nil {
|
||||||
return "", fmt.Errorf(
|
return "", nil
|
||||||
"Module '%s' not found for variable '%s'",
|
|
||||||
strings.Join(path[1:], "."),
|
|
||||||
v.FullKey())
|
|
||||||
}
|
}
|
||||||
|
|
||||||
value, ok := mod.Outputs[v.Field]
|
value, ok := mod.Outputs[v.Field]
|
||||||
|
|
|
@ -4362,6 +4362,22 @@ func TestContextRefresh_moduleInputComputedOutput(t *testing.T) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestContextRefresh_moduleVarModule(t *testing.T) {
|
||||||
|
m := testModule(t, "refresh-module-var-module")
|
||||||
|
p := testProvider("aws")
|
||||||
|
p.DiffFn = testDiffFn
|
||||||
|
ctx := testContext(t, &ContextOpts{
|
||||||
|
Module: m,
|
||||||
|
Providers: map[string]ResourceProviderFactory{
|
||||||
|
"aws": testProviderFuncFixed(p),
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
if _, err := ctx.Refresh(); err != nil {
|
||||||
|
t.Fatalf("err: %s", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// GH-70
|
// GH-70
|
||||||
func TestContextRefresh_noState(t *testing.T) {
|
func TestContextRefresh_noState(t *testing.T) {
|
||||||
p := testProvider("aws")
|
p := testProvider("aws")
|
||||||
|
|
Loading…
Reference in New Issue