diff --git a/terraform/node_resource_plan.go b/terraform/node_resource_plan.go index 9bbeedd159..faf72c1fd4 100644 --- a/terraform/node_resource_plan.go +++ b/terraform/node_resource_plan.go @@ -8,6 +8,15 @@ import ( // it is ready to be planned in order to create a diff. type NodePlannableResource struct { *NodeAbstractResource + + // Set by GraphNodeTargetable and used during DynamicExpand to + // forward targets downwards. + targets []ResourceAddress +} + +// GraphNodeTargetable +func (n *NodePlannableResource) SetTargets(targets []ResourceAddress) { + n.targets = targets } // GraphNodeEvalable @@ -83,6 +92,9 @@ func (n *NodePlannableResource) DynamicExpand(ctx EvalContext) (*Graph, error) { // Attach the state &AttachStateTransformer{State: state}, + // Targeting + &TargetsTransformer{ParsedTargets: n.targets}, + // Connect references so ordering is correct &ReferenceTransformer{},