Fix replace_triggered_by criteria

Only immediate changes to the resource are considered.
This commit is contained in:
James Bardin 2022-04-15 13:08:49 -04:00
parent 6670b71a2e
commit fb6fcf783b

View File

@ -336,7 +336,9 @@ func (ctx *BuiltinEvalContext) EvaluateReplaceTriggeredBy(expr hcl.Expression, r
// for any change.
if len(ref.Remaining) == 0 {
for _, c := range changes {
if c.ChangeSrc.Action != plans.NoOp {
switch c.ChangeSrc.Action {
// Only immediate changes to the resource will trigger replacement.
case plans.Update, plans.DeleteThenCreate, plans.CreateThenDelete:
return ref, true, diags
}
}