diff --git a/terraform/node_data_refresh.go b/terraform/node_data_refresh.go index 02d230155..f6c3f6d92 100644 --- a/terraform/node_data_refresh.go +++ b/terraform/node_data_refresh.go @@ -68,7 +68,7 @@ func (n *NodeRefreshableDataResource) DynamicExpand(ctx EvalContext) (*Graph, er default: expander.SetResourceSingle(path, n.ResourceAddr().Resource) } - instanceAddrs = append(instanceAddrs, expander.ExpandResource(path.Module(), n.ResourceAddr().Resource)...) + instanceAddrs = append(instanceAddrs, expander.ExpandResource(n.ResourceAddr().Absolute(path))...) } // Our graph transformers require access to the full state, so we'll diff --git a/terraform/node_resource_plan.go b/terraform/node_resource_plan.go index 0a339e6bb..73e059a64 100644 --- a/terraform/node_resource_plan.go +++ b/terraform/node_resource_plan.go @@ -70,9 +70,8 @@ func (n *NodePlannableResource) DynamicExpand(ctx EvalContext) (*Graph, error) { // Our instance expander should already have been informed about the // expansion of this resource and of all of its containing modules, so // it can tell us which instance addresses we need to process. - module := ctx.Path().Module() expander := ctx.InstanceExpander() - instanceAddrs := expander.ExpandResource(module, n.ResourceAddr().Resource) + instanceAddrs := expander.ExpandResource(n.ResourceAddr().Absolute(ctx.Path())) // We need to potentially rename an instance address in the state // if we're transitioning whether "count" is set at all. diff --git a/terraform/node_resource_refresh.go b/terraform/node_resource_refresh.go index 2284d1e43..68a087708 100644 --- a/terraform/node_resource_refresh.go +++ b/terraform/node_resource_refresh.go @@ -75,7 +75,7 @@ func (n *NodeRefreshableManagedResource) DynamicExpand(ctx EvalContext) (*Graph, expander.SetResourceSingle(module, n.ResourceAddr().Resource) } } - instanceAddrs := expander.ExpandResource(n.Addr.Module, n.ResourceAddr().Resource) + instanceAddrs := expander.ExpandModuleResource(n.Addr.Module, n.ResourceAddr().Resource) // Our graph transformers require access to the full state, so we'll // temporarily lock it while we work on this.