make sure to get a ResourceAddr for destroy refs

addr.Resource is sometimes a resource, except when it's an instance.
Make sure to always get the underlying resource.
This commit is contained in:
James Bardin 2019-11-21 10:33:00 -05:00
parent c47f100e56
commit 8510aa81ca

View File

@ -81,7 +81,7 @@ func (t *DestroyEdgeTransformer) Transform(g *Graph) error {
destroyers[key] = append(destroyers[key], n)
destroyerAddrs[key] = addr
resAddr := addr.Resource.Absolute(addr.Module).String()
resAddr := addr.Resource.Resource.Absolute(addr.Module).String()
destroyersByResource[resAddr] = append(destroyersByResource[resAddr], n)
case GraphNodeCreator:
addr := n.CreateAddr()