X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=vendor%2Fgithub.com%2Fhashicorp%2Fterraform%2Fterraform%2Fnode_resource_refresh.go;h=9daeabfa69cbef77c2eb1c9d5e4db0b59affbaa6;hb=refs%2Fheads%2Fadd_contact_groups;hp=95060232068a9d922117d6dcf5a9bba9c2395700;hpb=107c1cdb09c575aa2f61d97f48d8587eb6bada4c;p=github%2Ffretlink%2Fterraform-provider-statuscake.git diff --git a/vendor/github.com/hashicorp/terraform/terraform/node_resource_refresh.go b/vendor/github.com/hashicorp/terraform/terraform/node_resource_refresh.go index 9506023..9daeabf 100644 --- a/vendor/github.com/hashicorp/terraform/terraform/node_resource_refresh.go +++ b/vendor/github.com/hashicorp/terraform/terraform/node_resource_refresh.go @@ -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, },