udpate core to work with new ExpandResource

This also calls ExpandModuleResource in one location, because the logic
is not yet updated to handle actual module expansion, but that will be
fixed in a forthcoming PR.
pull/24444/head
James Bardin 6 years ago
parent 0d58537bf2
commit 1b3f5beeec

@ -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

@ -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.

@ -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.

Loading…
Cancel
Save