terraform/plans
Martin Atkins b802237e03 plans: Track an optional extra "reason" for some planned actions
Previously we were repeating some logic in the UI layer in order to
recover relevant additional context about a change to report to a user.
In order to help keep things consistent, and to have a clearer path for
adding more such things in the future, here we capture this user-facing
idea of an "action reason" within the plan model, and then use that
directly in order to decide how to describe the change to the user.

For the moment the "tainted" situation is the only one that gets a special
message, matching what we had before, but we can expand on this in future
in order to give better feedback about the other replace situations too.

This also preemptively includes the "replacing by request" reason, which
is currently not reachable but will be used in the near future as part of
implementing the -replace=... plan command line option to allow forcing
a particular object to be replaced.

So far we don't have any special reasons for anything other than replacing,
which makes sense because replacing is the only one that is in a sense
a special case of another action (Update), but this could expand to
other kinds of reasons in the future, such as explaining which of the
few different reasons a data source read might be deferred until the
apply step.
2021-04-29 17:50:46 -07:00
..
internal/planproto plans: Track an optional extra "reason" for some planned actions 2021-04-29 17:50:46 -07:00
objchange use new dynamic decoding behavior 2021-04-14 12:13:22 -04:00
planfile plans: Track an optional extra "reason" for some planned actions 2021-04-29 17:50:46 -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 add state to plans.Plan 2020-09-17 09:54:59 -04: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