decode change before creating diff

This is functionally equivalent, but will allow us to filter the change
values directly for reduced drift output.
This commit is contained in:
James Bardin
2022-02-04 14:24:36 -05:00
parent c02e8bc5b3
commit 0e7cec83db
4 changed files with 35 additions and 36 deletions

View File

@@ -234,6 +234,10 @@ func (rc *ResourceInstanceChange) Encode(ty cty.Type) (*ResourceInstanceChangeSr
}, err
}
func (rc *ResourceInstanceChange) Moved() bool {
return !rc.Addr.Equal(rc.PrevRunAddr)
}
// Simplify will, where possible, produce a change with a simpler action than
// the receiever given a flag indicating whether the caller is dealing with
// a normal apply or a destroy. This flag deals with the fact that Terraform