diff --git a/terraform/eval_apply.go b/terraform/eval_apply.go index a6f755dcb..5832fcd63 100644 --- a/terraform/eval_apply.go +++ b/terraform/eval_apply.go @@ -3,6 +3,7 @@ package terraform import ( "fmt" "log" + "reflect" "strings" multierror "github.com/hashicorp/go-multierror" @@ -118,7 +119,7 @@ func (n *EvalApply) Eval(ctx EvalContext) (interface{}, error) { // and we should not communicate with the provider or perform further action. eqV := unmarkedBefore.Equals(unmarkedAfter) eq := eqV.IsKnown() && eqV.True() - if change.Action == plans.Update && eq && (len(beforePaths) != len(afterPaths)) { + if change.Action == plans.Update && eq && !reflect.DeepEqual(beforePaths, afterPaths) { return nil, diags.ErrWithWarnings() } diff --git a/terraform/eval_diff.go b/terraform/eval_diff.go index aa45563ee..a639d23b9 100644 --- a/terraform/eval_diff.go +++ b/terraform/eval_diff.go @@ -3,6 +3,7 @@ package terraform import ( "fmt" "log" + "reflect" "strings" "github.com/hashicorp/hcl/v2" @@ -484,7 +485,7 @@ func (n *EvalDiff) Eval(ctx EvalContext) (interface{}, error) { // If we plan to write or delete sensitive paths from state, // this is an Update action - if action == plans.NoOp && len(priorPaths) != len(unmarkedPaths) { + if action == plans.NoOp && !reflect.DeepEqual(priorPaths, unmarkedPaths) { action = plans.Update }