de-specify module output references
Like resource references, we need to make instance references less specific when they aren't expanded yet during plan.
This commit is contained in:
parent
a805e14283
commit
b9ddec33e9
|
@ -80,6 +80,15 @@ type AbsModuleCallOutput struct {
|
||||||
Name string
|
Name string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ModuelCallOutput returns the referenceable ModuleCallOutput for this
|
||||||
|
// particular instance.
|
||||||
|
func (co AbsModuleCallOutput) ModuleCallOutput() ModuleCallOutput {
|
||||||
|
return ModuleCallOutput{
|
||||||
|
Call: co.Call.Call,
|
||||||
|
Name: co.Name,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func (co AbsModuleCallOutput) String() string {
|
func (co AbsModuleCallOutput) String() string {
|
||||||
return fmt.Sprintf("%s.%s", co.Call.String(), co.Name)
|
return fmt.Sprintf("%s.%s", co.Call.String(), co.Name)
|
||||||
}
|
}
|
||||||
|
|
|
@ -262,6 +262,11 @@ func (m *ReferenceMap) References(v dag.Vertex) []dag.Vertex {
|
||||||
subject = ri.ContainingResource()
|
subject = ri.ContainingResource()
|
||||||
case addrs.ResourceInstancePhase:
|
case addrs.ResourceInstancePhase:
|
||||||
subject = ri.ContainingResource()
|
subject = ri.ContainingResource()
|
||||||
|
case addrs.AbsModuleCallOutput:
|
||||||
|
subject = ri.ModuleCallOutput()
|
||||||
|
default:
|
||||||
|
log.Printf("[WARN] ReferenceTransformer: reference not found: %q", subject)
|
||||||
|
continue
|
||||||
}
|
}
|
||||||
key = m.referenceMapKey(v, subject)
|
key = m.referenceMapKey(v, subject)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue