terraform/plans
Martin Atkins 7c6e78bcb0 plans: Track both the previous run and prior states in the plan
Until now we've not really cared much about the state snapshot produced
by the previous Terraform operation, except to use it as a jumping-off
point for our refresh step.

However, we'd like to be able to report to an end-user whenever Terraform
detects a change that occurred outside of Terraform, because that's often
helpful context for understanding why a plan contains changes that don't
seem to have corresponding changes in the configuration.

As part of reporting that we'll need to keep track of the state as it
was before we did any refreshing work, so we can then compare that against
the state after refreshing. To retain enough data to achieve that, the
existing Plan field State is now two fields: PrevRunState and PriorState.

This also includes a very shallow change in the core package to make it
populate something somewhat-reasonable into this field so that integration
tests can function reasonably. However, this shallow implementation isn't
really sufficient for real-world use of PrevRunState because we'll
actually need to update PrevRunState as part of planning in order to
incorporate the results of any provider-specific state upgrades to make
the PrevRunState objects compatible with the current provider schema, or
else our diffs won't be valid. This deeper awareness of PrevRunState in
Terraform Core will follow in a subsequent commit, prior to anything else
making use of Plan.PrevRunState.
2021-05-05 15:11:05 -07:00
..
internal/planproto plans: Plan.Mode is now Plan.UIMode 2021-04-30 10:30:56 -07:00
objchange use new dynamic decoding behavior 2021-04-14 12:13:22 -04:00
planfile plans: Track both the previous run and prior states in the plan 2021-05-05 15:11:05 -07:00
action.go Version tools per Go convention under tools.go 2019-10-17 22:23:39 +02:00
action_string.go stringer: Regenerate files with latest version 2019-05-13 15:34:27 +01:00
changes.go plans: Track an optional extra "reason" for some planned actions 2021-04-29 17:50:46 -07:00
changes_src.go plans: Track an optional extra "reason" for some planned actions 2021-04-29 17:50:46 -07:00
changes_state.go plans: New package for in-memory plan models 2018-10-16 18:50:29 -07:00
changes_sync.go s/FullDestroy/IsFullDdestroy/ 2020-10-05 10:50:25 -04:00
doc.go plans: New package for in-memory plan models 2018-10-16 18:50:29 -07:00
dynamic_value.go Use UnmarkDeepWithPaths and MarkWithPaths 2020-09-10 11:04:17 -04:00
mode.go core: Generalize the idea of a "plan mode", vs just destroy flag 2021-04-27 08:23:54 -07:00
mode_string.go core: Generalize the idea of a "plan mode", vs just destroy flag 2021-04-27 08:23:54 -07:00
plan.go plans: Track both the previous run and prior states in the plan 2021-05-05 15:11:05 -07:00
plan_test.go don't render plan for module outputs 2020-11-17 09:31:18 -05:00
resourceinstancechangeactionreason_string.go plans: Track an optional extra "reason" for some planned actions 2021-04-29 17:50:46 -07:00