terraform: module input to another module doesn't error [GH-659]

This commit is contained in:
Mitchell Hashimoto 2014-12-16 08:22:55 -08:00
parent e1201f079a
commit e5f07567c6
3 changed files with 19 additions and 4 deletions

View File

@ -20,6 +20,8 @@ BUG FIXES:
diffing lists. [GH-661]
* core: fix crash where module inputs weren't strings, and add more
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
to any VPC. [GH-664]
* provider/aws: `vpc_id` is no longer required. [GH-667]

View File

@ -1623,10 +1623,7 @@ func (c *walkContext) computeModuleVariable(
// Get that module from our state
mod := c.Context.state.ModuleByPath(path)
if mod == nil {
return "", fmt.Errorf(
"Module '%s' not found for variable '%s'",
strings.Join(path[1:], "."),
v.FullKey())
return "", nil
}
value, ok := mod.Outputs[v.Field]

View File

@ -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
func TestContextRefresh_noState(t *testing.T) {
p := testProvider("aws")