terraform: enable targeting on expanded nodes

This commit is contained in:
Mitchell Hashimoto 2016-11-07 17:45:08 -08:00
parent d29844969a
commit bb9820cc0b
No known key found for this signature in database
GPG Key ID: 744E147AA52F5B0A
1 changed files with 12 additions and 0 deletions

View File

@ -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{},