terraform/internal/plans/planfile
Martin Atkins 22b36d1f4c Field for the previous address of each resource instance in the plan
In order to expose the effect of any relevant "moved" statements we dealt
with prior to creating the plan, we'll record with each
ResourceInstanceChange both is current address and the address it was
tracked at for the previous run.

To save consumers of these objects from having to special-case the
situation where there _was_ no previous run (e.g. because this is a Create
change), we'll just pretend the previous run address was the same as the
current address in that case, the same as for an update without any
renaming in effect.

This includes a breaking change to the plan file format, but one that
doesn't require a version number increment because there is no ambiguity
between the two formats and so mismatched parsers will already fail with
an error message.

As of this commit we've just added the new field but not yet populated it
with any useful information: it always just matches Addr. A future commit
will wire this up to the result of applying the moves so that we can
populate it correctly. We also don't yet expose this new information
anywhere in the UI layer.
2021-08-30 13:59:14 -07:00
..
testdata/test-config
config_snapshot.go
config_snapshot_test.go
doc.go
planfile_test.go Move states/ to internal/states/ 2021-05-17 14:09:07 -07:00
reader.go Move states/ to internal/states/ 2021-05-17 14:09:07 -07:00
tfplan.go Field for the previous address of each resource instance in the plan 2021-08-30 13:59:14 -07:00
tfplan_test.go Field for the previous address of each resource instance in the plan 2021-08-30 13:59:14 -07:00
writer.go Move states/ to internal/states/ 2021-05-17 14:09:07 -07:00