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.go12
1 files changed, 12 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 ab82163..dd92866 100644
--- a/vendor/github.com/hashicorp/terraform/terraform/node_data_refresh.go
+++ b/vendor/github.com/hashicorp/terraform/terraform/node_data_refresh.go
@@ -38,6 +38,16 @@ func (n *NodeRefreshableDataResource) DynamicExpand(ctx EvalContext) (*Graph, er
38 return nil, nil 38 return nil, nil
39 } 39 }
40 40
41 forEachMap, forEachKnown, forEachDiags := evaluateResourceForEachExpressionKnown(n.Config.ForEach, ctx)
42 if forEachDiags.HasErrors() {
43 return nil, diags.Err()
44 }
45 if !forEachKnown {
46 // If the for_each isn't known yet, we'll skip refreshing and try expansion
47 // again during the plan walk.
48 return nil, nil
49 }
50
41 // Next we need to potentially rename an instance address in the state 51 // Next we need to potentially rename an instance address in the state
42 // if we're transitioning whether "count" is set at all. 52 // if we're transitioning whether "count" is set at all.
43 fixResourceCountSetTransition(ctx, n.ResourceAddr(), count != -1) 53 fixResourceCountSetTransition(ctx, n.ResourceAddr(), count != -1)
@@ -77,6 +87,7 @@ func (n *NodeRefreshableDataResource) DynamicExpand(ctx EvalContext) (*Graph, er
77 Concrete: concreteResource, 87 Concrete: concreteResource,
78 Schema: n.Schema, 88 Schema: n.Schema,
79 Count: count, 89 Count: count,
90 ForEach: forEachMap,
80 Addr: n.ResourceAddr(), 91 Addr: n.ResourceAddr(),
81 }, 92 },
82 93
@@ -85,6 +96,7 @@ func (n *NodeRefreshableDataResource) DynamicExpand(ctx EvalContext) (*Graph, er
85 &OrphanResourceCountTransformer{ 96 &OrphanResourceCountTransformer{
86 Concrete: concreteResourceDestroyable, 97 Concrete: concreteResourceDestroyable,
87 Count: count, 98 Count: count,
99 ForEach: forEachMap,
88 Addr: n.ResourceAddr(), 100 Addr: n.ResourceAddr(),
89 State: state, 101 State: state,
90 }, 102 },