]> git.immae.eu Git - github/fretlink/terraform-provider-statuscake.git/blobdiff - vendor/github.com/hashicorp/terraform/terraform/node_resource_refresh.go
update vendor and go.mod
[github/fretlink/terraform-provider-statuscake.git] / vendor / github.com / hashicorp / terraform / terraform / node_resource_refresh.go
index 95060232068a9d922117d6dcf5a9bba9c2395700..9daeabfa69cbef77c2eb1c9d5e4db0b59affbaa6 100644 (file)
@@ -39,6 +39,11 @@ func (n *NodeRefreshableManagedResource) DynamicExpand(ctx EvalContext) (*Graph,
                return nil, diags.Err()
        }
 
+       forEachMap, forEachDiags := evaluateResourceForEachExpression(n.Config.ForEach, ctx)
+       if forEachDiags.HasErrors() {
+               return nil, diags.Err()
+       }
+
        // Next we need to potentially rename an instance address in the state
        // if we're transitioning whether "count" is set at all.
        fixResourceCountSetTransition(ctx, n.ResourceAddr(), count != -1)
@@ -66,6 +71,7 @@ func (n *NodeRefreshableManagedResource) DynamicExpand(ctx EvalContext) (*Graph,
                        Concrete: concreteResource,
                        Schema:   n.Schema,
                        Count:    count,
+                       ForEach:  forEachMap,
                        Addr:     n.ResourceAddr(),
                },
 
@@ -74,6 +80,7 @@ func (n *NodeRefreshableManagedResource) DynamicExpand(ctx EvalContext) (*Graph,
                &OrphanResourceCountTransformer{
                        Concrete: concreteResource,
                        Count:    count,
+                       ForEach:  forEachMap,
                        Addr:     n.ResourceAddr(),
                        State:    state,
                },