aboutsummaryrefslogtreecommitdiffhomepage
path: root/vendor/github.com/hashicorp/terraform/terraform/node_data_refresh.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/hashicorp/terraform/terraform/node_data_refresh.go')
-rw-r--r--vendor/github.com/hashicorp/terraform/terraform/node_data_refresh.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/vendor/github.com/hashicorp/terraform/terraform/node_data_refresh.go b/vendor/github.com/hashicorp/terraform/terraform/node_data_refresh.go
index d504c89..45129b3 100644
--- a/vendor/github.com/hashicorp/terraform/terraform/node_data_refresh.go
+++ b/vendor/github.com/hashicorp/terraform/terraform/node_data_refresh.go
@@ -33,6 +33,17 @@ func (n *NodeRefreshableDataResource) DynamicExpand(ctx EvalContext) (*Graph, er
33 } 33 }
34 } 34 }
35 35
36 // We also need a destroyable resource for orphans that are a result of a
37 // scaled-in count.
38 concreteResourceDestroyable := func(a *NodeAbstractResource) dag.Vertex {
39 // Add the config since we don't do that via transforms
40 a.Config = n.Config
41
42 return &NodeDestroyableDataResource{
43 NodeAbstractResource: a,
44 }
45 }
46
36 // Start creating the steps 47 // Start creating the steps
37 steps := []GraphTransformer{ 48 steps := []GraphTransformer{
38 // Expand the count. 49 // Expand the count.
@@ -42,6 +53,15 @@ func (n *NodeRefreshableDataResource) DynamicExpand(ctx EvalContext) (*Graph, er
42 Addr: n.ResourceAddr(), 53 Addr: n.ResourceAddr(),
43 }, 54 },
44 55
56 // Add the count orphans. As these are orphaned refresh nodes, we add them
57 // directly as NodeDestroyableDataResource.
58 &OrphanResourceCountTransformer{
59 Concrete: concreteResourceDestroyable,
60 Count: count,
61 Addr: n.ResourceAddr(),
62 State: state,
63 },
64
45 // Attach the state 65 // Attach the state
46 &AttachStateTransformer{State: state}, 66 &AttachStateTransformer{State: state},
47 67